How can i change so that it would look like this:
(example exhaust)
aggressive -> agressive = 7.5 seconds
heal -> heal = 6.5 seconds
// i want to add this
aggressive -> heal = 2.5 seconds
heal -> aggressive = 2.5 seconds
Code:void Spell::postCastSpell(Player* player, bool finishedCast /*= true*/, bool payCost /*= true*/) const { if(finishedCast){ if(!player->hasFlag(PlayerFlag_HasNoExhaustion)){ if(exhaustion != 0){ if(isAggressive){ if(exhaustion == -1) player->addCombatExhaust(g_config.getNumber(ConfigManager::COMBAT_EXHAUSTED)); else player->addCombatExhaust(exhaustion); }else{ if(exhaustion == -1) player->addHealExhaust(g_config.getNumber(ConfigManager::HEAL_EXHAUSTED)); else player->addHealExhaust(exhaustion); } } } }
yes that may be correct, since the spell you mean is inbetween both of them, i gave example above
& //acts as AND in operations.
&& //if the left-hand side expression is false, the combined result is false.
| //acts as OR in operations.
|| //if the left-hand side expression is true, the combined result is true.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10 * 1000)
setCombatCondition(combat, exhaust)
u don't need addExhaust functions.not sure how to do it since the heal exhaust is added in the else statement, and there is no "addExhaust()", just addHealExhaust() and addCombatExhaust()
function onCastSpell(cid, var)
player = Player(cid)
if player:getStorageValue(7238) >= os.time() then -- here we check if the player is exhausted
player:sendTextMessage(MESSAGE_INFO_DESCR, "You're exhausted")
else
player:setStorageValue(7238, os.time()+6.5) -- here we add the exhaust to the player (6.5 is how long exhaust is)
return doCombat(cid, combat, var)
end
end
function checkWeaponCooldown(player)
if weaponHitCooldowns[player:getId()] then return true end
end
function addWeaponCooldown(player, weaponT)
local cid = player:getId()
local weaponAS = weaponT[3]
local extraAS = leatherSetAS(player)
local cd = weaponAS-extraAS
if cd > 0 then
weaponHitCooldowns[cid] = true
addEvent(function() weaponHitCooldowns[cid] = nil end, cd)
end
end