• 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!

[Rogue Weapon] Plague Dagger [TFS 1.4]

Adorius Black

Advanced OT User
Joined
Mar 31, 2020
Messages
301
Solutions
3
Reaction score
180

Plague Dagger
Hi. I would like share with you this special dagger.
It deal DMG + there is 7% chance for PLAGUE EFFECT. PLAGUE EFFECT means that target get poison -20hp every 4 seconds 5 times and area damage with 50% bigger dmg than normal. This weapon also give you back mana points with every hit you make based on formula (level, skill, attack) Weapon has more bonuses like attack speed = 0.5s, you can fight with this dagger on 2 sqm distance, give you +30 speed, Absorb Earth and Death +10%, +3 mlvl, +20 HP, +140 MANA, +3 Sword Fighting


data/items/items.xml
XML:
    <item id="39060" article="a" name="Plague Dagger">
        <attribute key="weight" value="200" />
        <attribute key="weaponType" value="club" />
        <attribute key="attack" value="56" />
        <attribute key="attackspeed" value="500"/>
        <attribute key="range" value="2" />
        <attribute key="speed" value="60" />
        <attribute key="absorbPercentEarth" value="10"/>
        <attribute key="absorbPercentDeath" value="10"/>
        <attribute key="magiclevelpoints" value="3" />
        <attribute key="maxhitpoints" value="20"/>
        <attribute key="maxmanapoints" value="140"/>
        <attribute key="skillSword" value="3"/>
        <attribute key="description" value="[+20HP] [+140MP] [7% chance of PLAGUE EFFECT] [MANA BACK WEAPON]" />
    </item>

data/weapons/weapons.xml
XML:
    <melee id="39060" unproperly="1" level="0"  script="plague_dagger.lua"/> <!-- Plague Dagger -->

data/weapons/scripts/plague_dagger.lua
Lua:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON)
    setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.5, 0)

local condition = Condition(CONDITION_POISON)
    condition:setParameter(COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
    condition:setParameter(CONDITION_PARAM_DELAYED, true)
    condition:addDamage(5, 4000, -20)
    combat:addCondition(condition)

local arr = {
    {1, 0, 1},
    {0, 3, 0},
    {1, 0, 1}
}
 
local area = createCombatArea(arr)
    setCombatArea(combat, area)
 
local combat2 = createCombatObject()
    setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WHIRLWINDSWORD)
    setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0, 0, 1, 0)

function onUseWeapon(cid, var)
    local skill = getPlayerSkill(cid,SKILL_CLUB) -- Change this to the type of weapon you are using
    local mat = 0.085*0.5*56*skill+(getPlayerLevel(cid)/5) -- Change 54 to the attack of the weapon
    local min = 15 -- this means 15% minimum healing
    local max = 25 -- this means 25% maximum healing
    local addmana = math.random((mat * (min/100)), (mat * (max/100)))
    local rand = math.random(1,100)
    doPlayerAddMana(cid, addmana)
    if rand >= 93 then
        cid:say("PLAGUE!", TALKTYPE_MONSTER_SAY)
        doCombat(cid, combat, var)
    else
        doCombat(cid, combat2, var)
    end
end

data/movements/movements.xml
XML:
<!-- Plague Dagger -->
    <movevent event="Equip" itemid="39060" level="0" slot="hand" function="onEquipItem">
        <vocation name="Rogue" />
        <vocation name="Toxic Rogue" showInDescription="0" />
    </movevent>
    <movevent event="DeEquip" itemid="39060" slot="hand" function="onDeEquipItem" />

If you know how to make this code more easy, stable, correct or you are just bored and you have created nice modification of this code please post it here. OTLand users will be grateful. :)
 
Last edited:
Back
Top