• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Tfs 1.2 Bleeding spell to players and not monsters

SixNine

Active Member
Joined
Dec 12, 2018
Messages
452
Reaction score
41
1. Target spell

2. If you hit player it deals random 5-10% damage from his maxhealth per second for 4 seconds

3. If someone casted this spell on player no one can cast the same spell on him until those 4 seconds passes

4. Has different effect depending on characters id
 
Lua:
function onCastSpell(cid, var)
    local target = Creature(var.number)

    
    if not target or not target:isPlayer() then
        return false
    end
    
    
    if target:getCondition(CONDITION_BLEEDING) then
        return false
    end
    
    local duration = 4
    local minDamagePercent = 5
    local maxDamagePercent = 10
    
    local maxHealth = target:getMaxHealth()
    local minDamage = math.floor(maxHealth * minDamagePercent / 100)
    local maxDamage = math.floor(maxHealth * maxDamagePercent / 100)
    
 
    doTargetCombatHealth(cid, target:getId(), COMBAT_FIREDAMAGE, -minDamage, -maxDamage, CONST_ME_MAGIC_GREEN)
    
  
    addEvent(removeBleedingEffect, duration * 1000, target:getId())
    
    return true
end

function removeBleedingEffect(cid)
    local creature = Creature(cid)
    
    if creature and creature:isPlayer() then
        creature:removeCondition(CONDITION_BLEEDING)
    end
end

I'm interested in this magic. I created a simple script for it, but I haven't tested it yet. If anyone can take a look at this script and adapt it correctly for TFS 1.x I would be very grateful.
 
I'm interested in this magic. I created a simple script for it, but I haven't tested it yet. If anyone can take a look at this script and adapt it correctly for TFS 1.x I would be very grateful.
I think you missed 3, 4 part? That is quite important aswell
 
1. Target spell

2. If you hit player it deals random 5-10% damage from his maxhealth per second for 4 seconds

3. If someone casted this spell on player no one can cast the same spell on him until those 4 seconds passes

4. Has different effect depending on characters id
I think you missed 3, 4 part? That is quite important aswell
yea, diferent effects with char id, lol? if id 1 blueshimmer? if id 2 redshimmer? if id 1500 poff

he already do 3:
Lua:
    if target:getCondition(CONDITION_BLEEDING) then
        return false
    end
 
Back
Top