Page 1 of 3

Passive Spells

Posted: Thu Jul 05, 2012 8:12 pm
by Jabantiz
I have just submitted very basic work for passive spells. It adds 2 functions to player.cpp, AddPassiveSpell(int32 id, int8 tier) and ApplyPassiveSpells(). When ever a new sepll is added to the player AddPassiveSpell gets called if the spell is a passive spell (type/spell_book_type = 4) and will apply the spell right away. ApplyPassiveSpells should only be called after zoning is complete and it will apply all the passive spells at once.

With my limited time I was not able to test this as much as I would have liked so more tests, mainly with multiple passives, need to be done. Also there is no way to remove the effects of a passive spells while in a zone, they will be removed upon zoning if you removed the spell from the player.

Re: Passive Spells

Posted: Fri Jul 06, 2012 2:39 pm
by alfa
Spell couldown or count handle atm ?

Re: Passive Spells

Posted: Fri Jul 06, 2012 5:09 pm
by Jabantiz
My main concern is that it tries to cast all the passive spells at once, while passive spells are instant I am not sure if all spells will be processed when there is a large amount of them. Only had time to setup and test with 1 spell.

Re: Passive Spells

Posted: Fri Jul 06, 2012 6:52 pm
by Zcoretri
Very Nice...At least we have a starting point Jabantiz :mrgreen:

Re: Passive Spells

Posted: Fri Jul 06, 2012 7:56 pm
by John Adams
Excellent work, Jabantiz. We'll get this tested for you soon as possible. I have some time tonight, trying to finish up my own 1/2 done code like logon_equipment and some work on the Packet Analyzer. Hopefully my phone stops ringing for 2 f'n seconds so I can stay focused.

Crikey, it sucks being so popular :mrgreen: lol :oops:

Re: Passive Spells

Posted: Sat Jul 07, 2012 12:18 am
by John Adams
I was able to build a couple of test LUA scripts to apply when my Human Guardian logs in, and from what I see, it works... even through zoning.
passive1.jpg
Slashing and Defense were both 5/5 before the AddSkillBonus was applied via the passive spells. Now I am not too sure of the values, as I passed "5" as data into the LUA, so not really sure why it ended up 15/10, but the data is changing, and they are indeed "passive" so I am happy :)

Well done, Jabantiz.

Re: Passive Spells

Posted: Sat Jul 07, 2012 4:28 pm
by Jabantiz
That is interesting results, all I do is call the normal zoneserver->ProcessSpell to apply the spells, so not sure why the values are so off. The passives could be cast multiple times but not sure how that would happen.

Re: Passive Spells

Posted: Sat Jul 07, 2012 5:29 pm
by John Adams
It's likely that I used something unreasonable to test with. I didn't use just "buff str" or something simple. And we have no providers for setting recast of "Call of City" spells faster by 10s etc. There's a ton of C++ that is needed to support all these new Passives, but at least now we can put the traits data on the updater ;)

Re: Passive Spells

Posted: Wed Jul 11, 2012 5:03 am
by alfa
John Adams wrote:as data into the LUA, so not really sure why it ended up 15/10
Should be 15/15 display in green

Anyway, good work ;)

Re: Passive Spells

Posted: Wed Jul 11, 2012 11:06 am
by John Adams
alfa, this player was 5/5 before I applied the trait. That's why I didn't think 15 was correct since I only added 5.

Re: Passive Spells

Posted: Wed Jul 11, 2012 3:43 pm
by alfa
John Adams wrote:alfa, this player was 5/5 before I applied the trait. That's why I didn't think 15 was correct since I only added 5.
Woups :p

Re: Passive Spells

Posted: Sun Jul 22, 2012 10:34 pm
by Jabantiz
Zcoretri was able to verify what I was affraid of, more then 2 passive spells and they all didn't get applied. I was able to fix this issue by bypassing the spell queue so all passives are applied right away. I did quick tests with 4 passive spells and it all seems to work correctly now.

Another bug that John and I found was on revive passive spells were applied a second time (the original cast persists through death), and I just noticed tonight that on ld, if you beat the ld timer back passives were applied 2 more times. I believe I have fixed all these issues but more testing would be appreciated. All fixes are on dev svn.

Re: Passive Spells

Posted: Mon Jul 23, 2012 6:21 pm
by Zcoretri
Thanks Jabantiz. Only test so far that I have done is log in...all passives were applied...nice work once again :mrgreen:

Re: Passive Spells

Posted: Mon Aug 06, 2012 7:33 pm
by Jabantiz
Added the ability for passive spell effects to be removed (calls the lua remove function for the spell) without zoning. Just remove the spell from the player like you normally would (RemoveSpellBookEntry()), I also added a RemoveAllPassives() to remove all the passive spells the player currently has.

Re: Passive Spells

Posted: Tue Aug 07, 2012 12:16 pm
by John Adams
Cannot compile on Windows 7 x64 -

Code: Select all

1>..\..\source\WorldServer\Player.cpp(3420): error C3861: 'find': identifier not found
Code:

Code: Select all

void Player::RemovePassive(int32 id, int8 tier, bool remove_from_list)
{
	Spell* spell = 0;
	spell = master_spell_list.GetSpell(id, tier);
	if (spell) {
		SpellProcess* spellProcess = 0;
		spellProcess = GetZone()->GetSpellProcess();
		spellProcess->CastPassives(spell, this, true);

		if (remove_from_list) {
			vector<int32>::iterator remove;
			remove = find(passive_spells.begin(), passive_spells.end(), id);
			if (remove != passive_spells.end())
				passive_spells.erase(remove);
		}
	}
}
How did "find()" work for you, and not me? I thought it needed an object or something before it ({something}.find, for example)?