ArcEmu: Symbol Of Life Spell Doesn't Work - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Symbol Of Life Spell Doesn't Work

#1 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 26 April 2013 - 01:18 PM

In QIspells.cpp is a registration for the spell SymbolOfLife.
mgr->register_dummy_spell(8593, &SymbolOfLife);

However whenever you apply this spell the client shows 'Invalid target' and the function SymbolOfLife is not called. I put a simple print command in this function and it's not called.

But the spell is done. I can test it with a simple Lua script:

function SpellTest(event, pPlayer, SpellId, pSpellObject)
	print("SpellTest.lua: "..SpellId) 
end

RegisterServerHook(SERVER_HOOK_CAST_SPELL, "SpellTest")


Why I can catch this spell with Lua but not in cpp ?
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#2 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 26 April 2013 - 03:34 PM

Well actually this has nothing to do with the scripts what so ever. The problem is in the way the core handles spell targets. This spell has target limitations in the table `spelltargetconstraints` in your world db and that thing is not working properly. If you remove the entries from the db, you will be able to cast the spell.
0

#3 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 27 April 2013 - 04:47 AM

Well, looking to spell.cpp I have seen that in Spell:CanCast()

Unit* target = m_caster->GetMapMgr()->GetUnit(m_targets.m_unitTarget);


returns the player itself as target and not the selected target.

That's why the target checks fails also for target constraint.
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#4 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 27 April 2013 - 06:19 AM

I completely disabled the script and recompiled. The same thing is happening.
0

#5 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 27 April 2013 - 07:51 AM

I don't know what you have disabled but if I disable only this part in spell.cpp:

			if(m_target_constraint != NULL)
			{
				// Spell has GO and/or Creature target constraint, yet target is neither -> bad target
				if(!target->IsCreature() && !target->IsGameObject())
					return SPELL_FAILED_BAD_TARGETS;

				// target is the wrong creature
				if(target->IsCreature() && !m_target_constraint->HasCreature(target->GetEntry()))
					return SPELL_FAILED_BAD_TARGETS;

				// target is the wrong GO :/
				if(target->IsGameObject() && !m_target_constraint->HasGameobject(target->GetEntry()))
					return SPELL_FAILED_BAD_TARGETS;
			}


than it works. I think this has the same effect as deleting the records in spelltargetconstraints table.

However, the fault is in the core as I have described.
Unit* target = m_caster->GetMapMgr()->GetUnit(m_targets.m_unitTarget);

returns the player instead the target.

Such kind of fault may also be a reason why players claims that some spells casts on the player instead on the target.

Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#6 User is offline   eatos92 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 193
  • Joined: 06-May 09
  • Gender:Male
  • Location:Serbia, Devil WoW

Posted 30 April 2013 - 03:12 PM

What spell its self should do?
Posted Image
0

#7 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 30 April 2013 - 04:19 PM

What do you mean ?
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#8 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 01 May 2013 - 01:20 AM

View Posteatos92, on 30 April 2013 - 03:12 PM, said:

What spell its self should do?

The spell should cast on the player target, not on the player itself.
0

#9 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 01 May 2013 - 01:49 AM

Yes, this is a resurrection spell.

Similar spells are f.ex. healing spells. They also heal the player instead the targeted NPC. Such spells you need in quests.
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#10 User is offline   eatos92 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 193
  • Joined: 06-May 09
  • Gender:Male
  • Location:Serbia, Devil WoW

Posted 08 May 2013 - 06:07 PM

Yup i can also confirm that spell targets and messed up...
I tried last night some of the mine dummy spells,i created for quests, and they aint working,,, well effect is casting on me, instead on the target.

If you still have this issue do what i have done :) It is well not properly solved issue but at least now spells do work fine ^_^

bool DivineTouch(uint32 i, Spell * pSpell)
{
	if(pSpell->p_caster == NULL)
		return false;

	QuestLogEntry * ql = pSpell->p_caster->GetQuestLogForEntry(88786);
	Unit * unitTarget = pSpell->GetUnitTarget();

	if(!pSpell->p_caster->HasFinishedQuest(88786))
	{
		if(unitTarget->GetEntry() == 56081)
		{
			unitTarget->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
			unitTarget->Heal(unitTarget, 0, unitTarget->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
			TO_CREATURE(unitTarget)->Despawn(5000, 30000);
			ql->SetMobCount(0, 1);
			ql->UpdatePlayerFields();
		}
		else if(unitTarget->GetEntry() == 56082)
		{
			unitTarget->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
			unitTarget->Heal(unitTarget, 0, unitTarget->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
			TO_CREATURE(unitTarget)->Despawn(5000, 30000);
			ql->SetMobCount(1, 1);
			ql->UpdatePlayerFields();
		}
		else if(unitTarget->GetEntry() == 56083)
		{
			unitTarget->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
			unitTarget->Heal(unitTarget, 0, unitTarget->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
			TO_CREATURE(unitTarget)->Despawn(5000, 30000);
			ql->SetMobCount(2, 1);
			ql->UpdatePlayerFields();
		}
		else if(unitTarget->GetEntry() == 55084)
		{
			unitTarget->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
			unitTarget->Heal(unitTarget, 0, unitTarget->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
			TO_CREATURE(unitTarget)->Despawn(5000, 30000);
				
		}
		else if(unitTarget->GetEntry() == 56085)
		{
			unitTarget->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
			unitTarget->Heal(unitTarget, 0, unitTarget->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
			TO_CREATURE(unitTarget)->Despawn(5000, 30000);
			ql->SetMobCount(3, 1);
			ql->UpdatePlayerFields();
			TO_OBJECT(pSpell->p_caster)->Phase(PHASE_SET,1);
				
		}
	}
	else
	{
		pSpell->p_caster->Heal(pSpell->p_caster, 0,18650);
		return true; 
	}

}

Posted Image
0

#11 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 08 May 2013 - 11:08 PM

Fix the targeting then and it will work :P
"The demand for free goods is infinite."
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users