Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 592
- Reaction score
- 64
Hello, so i noticed a issue with spells.xml im using cooldown="0" or exhaustion="0" the reason i set it to 0 so the spell wont have exhaust and i could execute the spell instantly, but the problem seems like it ignores the set value 0 and it sets to default 1 second i assume the problem is here
C++:
if (!player->hasFlag(PlayerFlag_HasNoExhaustion)) {
if (player->hasCondition(CONDITION_SPELLGROUPCOOLDOWN, group) || player->hasCondition(CONDITION_SPELLCOOLDOWN, spellId)) {
player->sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED);
if (isInstant()) {
//g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
}
return false;
}
}
C++:
void Spell::postCastSpell(Player* player, bool finishedCast /*= true*/, bool payCost /*= true*/) const
{
if (finishedCast) {
if (!player->hasFlag(PlayerFlag_HasNoExhaustion)) {
if (cooldown > 0) {
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_SPELLCOOLDOWN, cooldown, 0, false, spellId);
player->addCondition(condition);
}
if (groupCooldown > 0) {
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_SPELLGROUPCOOLDOWN, groupCooldown, 0, false, group);
player->addCondition(condition);
}
if (!player->hasFlag(PlayerFlag_NotGainInFight)) {
if (aggressive) {
player->addInFightTicks();
}
}
}
}
if (payCost) {
Spell::postCastSpell(player, getManaCost(player), getSoulCost());
}
}