Help with custom code

Post Reply
dragonarmor
Posts: 36
Joined: Sat Feb 21, 2015 10:08 am

Help with custom code

Post by dragonarmor » Mon Jan 08, 2018 10:28 am

I am doing some custom server coding and need help with compile error:
It's on the "if(battleutils::CalculateSpellCost" line

player_charm_controller.cpp(2650): error C2664: 'CSpell *spell::GetSpell(SpellID)': cannot convert argument 1 from 'uint16' to 'SpellID'

Code: Select all

		// *** If no healing is needed but I need to Raise someone, then pick a Raise Spell ***
		if ((SpellID == 13) || (SpellID == 12 && IsMainHealer)) {
			SpellID = 0;
			TestSpellID = 12; // RAISE I
			if (charutils::hasSpell(PCaster, TestSpellID) && PCaster->CanUseSpell(spell::GetSpell(TestSpellID))) {
				if ((!PCaster->PRecastContainer->HasRecast(RECAST_MAGIC, TestSpellID, 0))) {
					if (battleutils::CalculateSpellCost(POwner, spell::GetSpell(TestSpellID)) < PCaster->health.mp)
					{
						SpellID = TestSpellID; // Pick RAISE I
					}
				}
			}
			TestSpellID = 13; // RAISE II
			if (charutils::hasSpell(PCaster, TestSpellID) && PCaster->CanUseSpell(spell::GetSpell(TestSpellID))) {
				if ((!PCaster->PRecastContainer->HasRecast(RECAST_MAGIC, TestSpellID, 0))) {
					if (battleutils::CalculateSpellCost(POwner, spell::GetSpell(TestSpellID)) < PCaster->health.mp)
					{
						SpellID = TestSpellID; // Pick RAISE II
					}
				}
			}

Post Reply