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

If physical damage with sword...

The Frenesy

Member
Joined
Sep 3, 2020
Messages
32
Solutions
1
Reaction score
7
I need a system for the TFS 0.4 server.

If the target takes damage from sword-type weapons, play a sound effect.

Lua:
sendScreanSound(cid, "SwordDamage.wav")

The function to reproduce the sound effect is this code above, however I don't know how to build the rest of the code.
Thank you, I count on your help.
 
sendScreanSound(cid, "SwordDamage.wav")

comment_NtYESTYK2U6kwqbrSK23Hr2rQQMDegcQ.jpg


You can send on attack extendedopcode, then Otclient will play sound if receive this packet.
 
sendScreanSound(cid, "SwordDamage.wav")

comment_NtYESTYK2U6kwqbrSK23Hr2rQQMDegcQ.jpg


You can send on attack extendedopcode, then Otclient will play sound if receive this packet.

This code above that I mentioned, is used to play sound effect in OTClient. I was able to apply this code to spells, potions, foods and other things.

But unfortunately I have no idea how to apply this code during combat with certain types of weapons.

See an example of the magic "exevo vis hur", it worked.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 11)

local area = createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    sendScreanSound(cid, "EnergyEffect.wav")
    return doCombat(cid, combat, var)
end
 
This code above refers to the sound system in OTClient, I was able to apply it to various scripts on the server itself, such as spells, potions, ports and etc.

See the example below, the script below is from the "Exevo vis hur" spell, where I insert the code to play the sound effect when casting the spell.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 11)

local area = createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    [B]sendScreanSound(cid, "EnergyEffect.wav")[/B]
    return doCombat(cid, combat, var)
end
U get mod from Tibiaking? Why you dont follow instructions? U compile everyrhing correct?
 
U get mod from Tibiaking? Why you dont follow instructions? U compile everyrhing correct?

Exactly, this system is available on TibiaKing, that's where I got the sound system.

I can use this system normally, but I don't understand scripts, I don't know how to do what I need.
 
Solution
Back
Top