underewar
Well-Known Member
I want to share with you guys this example, becauase its not to hard to do, and i see alot post with people doing it wrong.
Hello guys, recently i was struglin to make effect follow players and avoid this behavior
First i was trying to create a new c++ function to handle DrawEffectAttached, after some research i discovery aura system for otcv8 its already doing exact this.
This is final result wich new custom effect following the player frame by frame without an new call.
So lets talk about the aproach i got to make this new effect for spells:
That means like mounts wich its bellow origin outfit, in this case we use this above character to use like an effect.
New Added
Added Effect animation
Define function to handle aura effect start
Define function to handle aura effect stop
Its very simple, now when we want to call an effect we use this outfit type.
I have worked in multiple function to make the code better and clean.
New Added
Added Effect Damage
Define function to handle detection based on targeted monster.
Define function to handle damage in detection area in targeted monster.
Well in this case instead filter an array with all creature in screen, and aiming increase perfomance in any scenario i have added a verywell made custom detect monster based on creature target for this new target system.
increased this range will increase radius of effect in targeted spell.
Also we have an new system for targeted damage now we can apply range wich increase the Radius in genki dama increasing the arround damage when hited.
New Added
effect_list
To this works well you need to add aura with looktype id on auras.xml
This list will maintain all Constants for these system bellow.
Examples:
when you need to acess in any lua script just use obj orientation, that mean acess keys using obj
effect.sayian.genki_dama to acess the value 918
Important:
Todo:
Instead have an file effect_list we should load direct from aura.xml(Its beeing a redundant file at momment)
Hello guys, recently i was struglin to make effect follow players and avoid this behavior
First i was trying to create a new c++ function to handle DrawEffectAttached, after some research i discovery aura system for otcv8 its already doing exact this.
This is final result wich new custom effect following the player frame by frame without an new call.
So lets talk about the aproach i got to make this new effect for spells:
New Spell System Rework
New Spell Added Genki Dama
This system use as core outfit from tibia spr to find an aura type with outfit.lookauraHow outfit.lookAura works?
Its use the same structure for draw outfit to draw any other on Z-Index.That means like mounts wich its bellow origin outfit, in this case we use this above character to use like an effect.
New Added
Added Effect animation
Define function to handle aura effect start
LUA:
Spell:startEffectAnimation(player, auraEffect)
LUA:
Spell:stopEffectAnimation(player, targetPos)
Its very simple, now when we want to call an effect we use this outfit type.
I have worked in multiple function to make the code better and clean.
New Added
Added Effect Damage
Define function to handle detection based on targeted monster.
LUA:
TargetSpell:getCreaturesInRange(position, range)
LUA:
TargetSpell:applyDamageToMonstersAroundPosition(player, targetPos, minDamage, maxDamage, range)
Well in this case instead filter an array with all creature in screen, and aiming increase perfomance in any scenario i have added a verywell made custom detect monster based on creature target for this new target system.
increased this range will increase radius of effect in targeted spell.
Also we have an new system for targeted damage now we can apply range wich increase the Radius in genki dama increasing the arround damage when hited.
New Added
effect_list
To this works well you need to add aura with looktype id on auras.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<auras>
<aura id="1" clientid="918" name="Genki Dama Effect" speed="20" />
</auras>
Examples:
LUA:
effect = {
sayian = {
genki_dama = 918,
},
-- This is how maintain new effects in this file.
creatures = {
fireBallNewExample = 6666
},
}
when you need to acess in any lua script just use obj orientation, that mean acess keys using obj
effect.sayian.genki_dama to acess the value 918
Important:
Todo:
- Spell Stats Manager, Increase and Decrease Values
- Add Combat Function to spell damage (Comented in ApplyDamageFunction)
- Spell Stats Min,Max Damage
- Spell Stats AreaOfEffect(AOE)
Instead have an file effect_list we should load direct from aura.xml(Its beeing a redundant file at momment)