The Forgotten Tibia (no vocations, new skills, skills by points, dual wield, auto loot, quiver, etc)

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
sup how can i add const_me_critical_damage effect into the script?
tried this but didnt worked
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

function onUseWeapon(player, variant)
    if not combat:execute(player, variant) then
        return false
    end

    if math.random(1, 100) <= 25 then
        return false
    end

    if Creature(variant:getNumber()):isPlayer() then
        local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.01) + 1)
        player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4)
        
    else
        local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.02) + 1)
        player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 2, 4)
    
    end
    return true
end
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
@nokturno
Searched in all files for "const_me_", it is the second last. Dont know if it will work on lua script.

Code:
 TheForgottenTibia\Server\src\luascript.cpp (87 hits)
    Line 1192:     registerEnum(CONST_ME_NONE)
    Line 1193:     registerEnum(CONST_ME_DRAWBLOOD)
    Line 1194:     registerEnum(CONST_ME_LOSEENERGY)
    Line 1195:     registerEnum(CONST_ME_POFF)
    Line 1196:     registerEnum(CONST_ME_BLOCKHIT)
    Line 1197:     registerEnum(CONST_ME_EXPLOSIONAREA)
    Line 1198:     registerEnum(CONST_ME_EXPLOSIONHIT)
    Line 1199:     registerEnum(CONST_ME_FIREAREA)
    Line 1200:     registerEnum(CONST_ME_YELLOW_RINGS)
    Line 1201:     registerEnum(CONST_ME_GREEN_RINGS)
    Line 1202:     registerEnum(CONST_ME_HITAREA)
    Line 1203:     registerEnum(CONST_ME_TELEPORT)
    Line 1204:     registerEnum(CONST_ME_ENERGYHIT)
    Line 1205:     registerEnum(CONST_ME_MAGIC_BLUE)
    Line 1206:     registerEnum(CONST_ME_MAGIC_RED)
    Line 1207:     registerEnum(CONST_ME_MAGIC_GREEN)
    Line 1208:     registerEnum(CONST_ME_HITBYFIRE)
    Line 1209:     registerEnum(CONST_ME_HITBYPOISON)
    Line 1210:     registerEnum(CONST_ME_MORTAREA)
    Line 1211:     registerEnum(CONST_ME_SOUND_GREEN)
    Line 1212:     registerEnum(CONST_ME_SOUND_RED)
    Line 1213:     registerEnum(CONST_ME_POISONAREA)
    Line 1214:     registerEnum(CONST_ME_SOUND_YELLOW)
    Line 1215:     registerEnum(CONST_ME_SOUND_PURPLE)
    Line 1216:     registerEnum(CONST_ME_SOUND_BLUE)
    Line 1217:     registerEnum(CONST_ME_SOUND_WHITE)
    Line 1218:     registerEnum(CONST_ME_BUBBLES)
    Line 1219:     registerEnum(CONST_ME_CRAPS)
    Line 1220:     registerEnum(CONST_ME_GIFT_WRAPS)
    Line 1221:     registerEnum(CONST_ME_FIREWORK_YELLOW)
    Line 1222:     registerEnum(CONST_ME_FIREWORK_RED)
    Line 1223:     registerEnum(CONST_ME_FIREWORK_BLUE)
    Line 1224:     registerEnum(CONST_ME_STUN)
    Line 1225:     registerEnum(CONST_ME_SLEEP)
    Line 1226:     registerEnum(CONST_ME_WATERCREATURE)
    Line 1227:     registerEnum(CONST_ME_GROUNDSHAKER)
    Line 1228:     registerEnum(CONST_ME_HEARTS)
    Line 1229:     registerEnum(CONST_ME_FIREATTACK)
    Line 1230:     registerEnum(CONST_ME_ENERGYAREA)
    Line 1231:     registerEnum(CONST_ME_SMALLCLOUDS)
    Line 1232:     registerEnum(CONST_ME_HOLYDAMAGE)
    Line 1233:     registerEnum(CONST_ME_BIGCLOUDS)
    Line 1234:     registerEnum(CONST_ME_ICEAREA)
    Line 1235:     registerEnum(CONST_ME_ICETORNADO)
    Line 1236:     registerEnum(CONST_ME_ICEATTACK)
    Line 1237:     registerEnum(CONST_ME_STONES)
    Line 1238:     registerEnum(CONST_ME_SMALLPLANTS)
    Line 1239:     registerEnum(CONST_ME_CARNIPHILA)
    Line 1240:     registerEnum(CONST_ME_PURPLEENERGY)
    Line 1241:     registerEnum(CONST_ME_YELLOWENERGY)
    Line 1242:     registerEnum(CONST_ME_HOLYAREA)
    Line 1243:     registerEnum(CONST_ME_BIGPLANTS)
    Line 1244:     registerEnum(CONST_ME_CAKE)
    Line 1245:     registerEnum(CONST_ME_GIANTICE)
    Line 1246:     registerEnum(CONST_ME_WATERSPLASH)
    Line 1247:     registerEnum(CONST_ME_PLANTATTACK)
    Line 1248:     registerEnum(CONST_ME_TUTORIALARROW)
    Line 1249:     registerEnum(CONST_ME_TUTORIALSQUARE)
    Line 1250:     registerEnum(CONST_ME_MIRRORHORIZONTAL)
    Line 1251:     registerEnum(CONST_ME_MIRRORVERTICAL)
    Line 1252:     registerEnum(CONST_ME_SKULLHORIZONTAL)
    Line 1253:     registerEnum(CONST_ME_SKULLVERTICAL)
    Line 1254:     registerEnum(CONST_ME_ASSASSIN)
    Line 1255:     registerEnum(CONST_ME_STEPSHORIZONTAL)
    Line 1256:     registerEnum(CONST_ME_BLOODYSTEPS)
    Line 1257:     registerEnum(CONST_ME_STEPSVERTICAL)
    Line 1258:     registerEnum(CONST_ME_YALAHARIGHOST)
    Line 1259:     registerEnum(CONST_ME_BATS)
    Line 1260:     registerEnum(CONST_ME_SMOKE)
    Line 1261:     registerEnum(CONST_ME_INSECTS)
    Line 1262:     registerEnum(CONST_ME_DRAGONHEAD)
    Line 1263:     registerEnum(CONST_ME_ORCSHAMAN)
    Line 1264:     registerEnum(CONST_ME_ORCSHAMAN_FIRE)
    Line 1265:     registerEnum(CONST_ME_THUNDER)
    Line 1266:     registerEnum(CONST_ME_FERUMBRAS)
    Line 1267:     registerEnum(CONST_ME_CONFETTI_HORIZONTAL)
    Line 1268:     registerEnum(CONST_ME_CONFETTI_VERTICAL)
    Line 1269:     registerEnum(CONST_ME_BLACKSMOKE)
    Line 1270:     registerEnum(CONST_ME_REDSMOKE)
    Line 1271:     registerEnum(CONST_ME_YELLOWSMOKE)
    Line 1272:     registerEnum(CONST_ME_GREENSMOKE)
    Line 1273:     registerEnum(CONST_ME_PURPLESMOKE)
    Line 1274:     registerEnum(CONST_ME_EARLY_THUNDER)
    Line 1275:     registerEnum(CONST_ME_RAGIAZ_BONECAPSULE)
    Line 1276:     registerEnum(CONST_ME_CRITICAL_DAMAGE)
    Line 1277:     registerEnum(CONST_ME_PLUNGING_FISH)

Edit: ah you already know that kkkk
I dont know why, try support or searching a solution, this is an issue from TFS 1.3
 
Last edited:

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
@nokturno
Searched in all files for "const_me_", it is the second last. Dont know if it will work on lua script.

Code:
 TheForgottenTibia\Server\src\luascript.cpp (87 hits)
    Line 1192:     registerEnum(CONST_ME_NONE)
    Line 1193:     registerEnum(CONST_ME_DRAWBLOOD)
    Line 1194:     registerEnum(CONST_ME_LOSEENERGY)
    Line 1195:     registerEnum(CONST_ME_POFF)
    Line 1196:     registerEnum(CONST_ME_BLOCKHIT)
    Line 1197:     registerEnum(CONST_ME_EXPLOSIONAREA)
    Line 1198:     registerEnum(CONST_ME_EXPLOSIONHIT)
    Line 1199:     registerEnum(CONST_ME_FIREAREA)
    Line 1200:     registerEnum(CONST_ME_YELLOW_RINGS)
    Line 1201:     registerEnum(CONST_ME_GREEN_RINGS)
    Line 1202:     registerEnum(CONST_ME_HITAREA)
    Line 1203:     registerEnum(CONST_ME_TELEPORT)
    Line 1204:     registerEnum(CONST_ME_ENERGYHIT)
    Line 1205:     registerEnum(CONST_ME_MAGIC_BLUE)
    Line 1206:     registerEnum(CONST_ME_MAGIC_RED)
    Line 1207:     registerEnum(CONST_ME_MAGIC_GREEN)
    Line 1208:     registerEnum(CONST_ME_HITBYFIRE)
    Line 1209:     registerEnum(CONST_ME_HITBYPOISON)
    Line 1210:     registerEnum(CONST_ME_MORTAREA)
    Line 1211:     registerEnum(CONST_ME_SOUND_GREEN)
    Line 1212:     registerEnum(CONST_ME_SOUND_RED)
    Line 1213:     registerEnum(CONST_ME_POISONAREA)
    Line 1214:     registerEnum(CONST_ME_SOUND_YELLOW)
    Line 1215:     registerEnum(CONST_ME_SOUND_PURPLE)
    Line 1216:     registerEnum(CONST_ME_SOUND_BLUE)
    Line 1217:     registerEnum(CONST_ME_SOUND_WHITE)
    Line 1218:     registerEnum(CONST_ME_BUBBLES)
    Line 1219:     registerEnum(CONST_ME_CRAPS)
    Line 1220:     registerEnum(CONST_ME_GIFT_WRAPS)
    Line 1221:     registerEnum(CONST_ME_FIREWORK_YELLOW)
    Line 1222:     registerEnum(CONST_ME_FIREWORK_RED)
    Line 1223:     registerEnum(CONST_ME_FIREWORK_BLUE)
    Line 1224:     registerEnum(CONST_ME_STUN)
    Line 1225:     registerEnum(CONST_ME_SLEEP)
    Line 1226:     registerEnum(CONST_ME_WATERCREATURE)
    Line 1227:     registerEnum(CONST_ME_GROUNDSHAKER)
    Line 1228:     registerEnum(CONST_ME_HEARTS)
    Line 1229:     registerEnum(CONST_ME_FIREATTACK)
    Line 1230:     registerEnum(CONST_ME_ENERGYAREA)
    Line 1231:     registerEnum(CONST_ME_SMALLCLOUDS)
    Line 1232:     registerEnum(CONST_ME_HOLYDAMAGE)
    Line 1233:     registerEnum(CONST_ME_BIGCLOUDS)
    Line 1234:     registerEnum(CONST_ME_ICEAREA)
    Line 1235:     registerEnum(CONST_ME_ICETORNADO)
    Line 1236:     registerEnum(CONST_ME_ICEATTACK)
    Line 1237:     registerEnum(CONST_ME_STONES)
    Line 1238:     registerEnum(CONST_ME_SMALLPLANTS)
    Line 1239:     registerEnum(CONST_ME_CARNIPHILA)
    Line 1240:     registerEnum(CONST_ME_PURPLEENERGY)
    Line 1241:     registerEnum(CONST_ME_YELLOWENERGY)
    Line 1242:     registerEnum(CONST_ME_HOLYAREA)
    Line 1243:     registerEnum(CONST_ME_BIGPLANTS)
    Line 1244:     registerEnum(CONST_ME_CAKE)
    Line 1245:     registerEnum(CONST_ME_GIANTICE)
    Line 1246:     registerEnum(CONST_ME_WATERSPLASH)
    Line 1247:     registerEnum(CONST_ME_PLANTATTACK)
    Line 1248:     registerEnum(CONST_ME_TUTORIALARROW)
    Line 1249:     registerEnum(CONST_ME_TUTORIALSQUARE)
    Line 1250:     registerEnum(CONST_ME_MIRRORHORIZONTAL)
    Line 1251:     registerEnum(CONST_ME_MIRRORVERTICAL)
    Line 1252:     registerEnum(CONST_ME_SKULLHORIZONTAL)
    Line 1253:     registerEnum(CONST_ME_SKULLVERTICAL)
    Line 1254:     registerEnum(CONST_ME_ASSASSIN)
    Line 1255:     registerEnum(CONST_ME_STEPSHORIZONTAL)
    Line 1256:     registerEnum(CONST_ME_BLOODYSTEPS)
    Line 1257:     registerEnum(CONST_ME_STEPSVERTICAL)
    Line 1258:     registerEnum(CONST_ME_YALAHARIGHOST)
    Line 1259:     registerEnum(CONST_ME_BATS)
    Line 1260:     registerEnum(CONST_ME_SMOKE)
    Line 1261:     registerEnum(CONST_ME_INSECTS)
    Line 1262:     registerEnum(CONST_ME_DRAGONHEAD)
    Line 1263:     registerEnum(CONST_ME_ORCSHAMAN)
    Line 1264:     registerEnum(CONST_ME_ORCSHAMAN_FIRE)
    Line 1265:     registerEnum(CONST_ME_THUNDER)
    Line 1266:     registerEnum(CONST_ME_FERUMBRAS)
    Line 1267:     registerEnum(CONST_ME_CONFETTI_HORIZONTAL)
    Line 1268:     registerEnum(CONST_ME_CONFETTI_VERTICAL)
    Line 1269:     registerEnum(CONST_ME_BLACKSMOKE)
    Line 1270:     registerEnum(CONST_ME_REDSMOKE)
    Line 1271:     registerEnum(CONST_ME_YELLOWSMOKE)
    Line 1272:     registerEnum(CONST_ME_GREENSMOKE)
    Line 1273:     registerEnum(CONST_ME_PURPLESMOKE)
    Line 1274:     registerEnum(CONST_ME_EARLY_THUNDER)
    Line 1275:     registerEnum(CONST_ME_RAGIAZ_BONECAPSULE)
    Line 1276:     registerEnum(CONST_ME_CRITICAL_DAMAGE)
    Line 1277:     registerEnum(CONST_ME_PLUNGING_FISH)

Edit: ah you already know that kkkk
Yeah the effect is correct but dont know the rest
 

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
trying this btw

Lua:
if Creature(variant:getNumber()):isPlayer() then
        local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.01) + 1)
        player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4)
        Creature(variant:getNumber()):sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)
but getting this
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
@nokturno
It is saying that CONST_ME_CRITICAL_DAMAGE == null.
I don't know why, maybe you have to define somewhere in source code or lua libs to be accessible to other scripts. I think people on support forum can help you, and I dont think this is a issue only from my project. You can try other effects too and see if it happens to any other or only with critical.

I tried to follow CONST_ME_TELEPORT on source code (using 'find all references') and didnt see any difference from CONST_ME_CRITICAL.
My guess is that need to add something in some lua lib in data pack.

You can try using on a NPC too, or with a talkaction, just to see if the problem is on CONST_ME_CRITICAL_DAMAGE or on using it as a weapon script.

Try targetPos:sendMagicEffect(CONST_ME_CRITICAL_DAMAGE) (you have to get somehow the targetPos, dont know if using 'targetPos' will work), like:
Code:
TheForgottenTibia\Server\data\actions\scripts\quests\customquests.lua
    Line 423:                     monster1:getPosition():sendMagicEffect(CONST_ME_TELEPORT)

TheForgottenTibia\Server\data\actions\scripts\quests\dhlever.lua
    Line 27:             p[2]:sendMagicEffect(CONST_ME_TELEPORT)

TheForgottenTibia\Server\data\creaturescripts\scripts\skillpoints.lua
    Line 70:             player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
 
Last edited:

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
Yeah im trying others effects but is the same error
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
Last edited:

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
713
Best answers
0
Reaction score
172
Nice work @Togu, I'm subscribed to your thread.
BTW, How do I activate autoloot?
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
Did something cool here:

35347

But still has some minor bugs.
And now database may not be compatible with other AACs cause I deleted some columns from player table (check latest commits).

Also still need to make player earn points when leveling cause all the skill points system was reworked and transfered from lua to c++.
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
I was using Gesior AAC but I think it wasn't the latest version, just a versions compatible with TFS 1.3 that I found.
But now I have to change some files from the AAC when acessing database.
Use notepad++, do ctrl + f, go to "search in files" tab, select the AAC folder and search for:
Code:
`manaspent`
`skill_fist_tries`
`skill_club_tries`
(...)
I'm sure you will find the files you need to change to make it work
 

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
also im getting a error with the latest commints



more info here

 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
35385
Did a fresh download and everything is ok

Remember to set "Release" and x86 or x64
 

nokturno

Not a human
Joined
Aug 7, 2009
Messages
326
Best answers
0
Reaction score
128
Im adding your commits to your previous project, cuz i have custom code added there :(
 
OP
Togu

Togu

Active Member
Joined
Jun 22, 2018
Messages
245
Best answers
1
Reaction score
101
Location
Brazil
Added a ZnoteAAC (not 100% done).

Also on data/XML folder:

stages.xml: configures the skillPointsPerLevel
Code:
<stages>
    <config enabled="1" />
    <stage minLevel="1" maxLevel="8" multiplier="20" pointsPerLevel="2"/>
    <stage minLevel="8" maxLevel="40" multiplier="17" pointsPerLevel="4"/>
    <stage minLevel="41" maxLevel="60" multiplier="17" pointsPerLevel="3"/>
    <stage minLevel="61" maxLevel="80" multiplier="15" pointsPerLevel="2"/>
    <stage minLevel="81" maxLevel="100" multiplier="13" pointsPerLevel="1"/>
    <stage minLevel="101" multiplier="10" pointsPerLevel="1"/>
</stages>
skills.xml: configures all skill gains but not everything is done (soul, walkSpeed and attackSpeed are not being used at the moment, the goal is to make everything customizable so you can choose which skill will increase which stat and in the far future skill names and skill gains will be parsed automatically to client and you will just need to change on server-side and it will be automatically changed on client, same for spells)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<skills>

    <skill id="0" name="Vitality" cost="1"
        health="15"
        mana="0"
        soul="0"
        cap="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>

    <skill id="1" name="Strenght" cost="1"
        health="0"
        mana="0"
        soul="0"
        cap="5"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>

    <skill id="2" name="Faith" cost="1"
        health="0"
        mana="10"
        cap="0"
        soul="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="2"/>

    <skill id="3" name="Intelligence" cost="1"
        health="0"
        mana="10"
        cap="0"
        soul="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="1"
        rodMaxDamage="0"/>

    <skill id="4" name="Dexterity" cost="1"
        health="0"
        mana="0"
        soul="0"
        cap="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>

    <skill id="5" name="Defence" cost="1"
        health="5"
        mana="0"
        soul="0"
        cap="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>
        
    <skill id="6" name="Endurance" cost="1"
        health="5"
        mana="0"
        cap="15"
        soul="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>

    <skill id="7" name="Magic" cost="3"
        health="0"
        mana="15"
        cap="0"
        soul="0"
        walkSpeed="0"
        attackSpeed="0"
        wandMaxDamage="0"
        rodMaxDamage="0"/>

</skills>
 
Last edited:

procurando

Well-Known Member
Joined
Jun 8, 2014
Messages
12
Best answers
0
Reaction score
0
Hello! U did a amazing job, i'm new on server and i've tried to follow ur guide to open the server for test but when i tried to copy client things (tiba.spr and tibia.dat ) from master folder "C:\Users\XXXX\Desktop\TheForgottenTibia-master\Client\data\things\1098"
Theres only items.otb on this folder.. what should i do?
 
Top