E
Evil Puncker
Guest
wonderful system, I'm going to use this for sure, the only thing I miss was an onManaChange event so all damage applies to utamo vita users too
an onManaChange event
Thanks man! Much appreciated!wonderful system
nice thinking, if people could even imagine how amazing and personalized this system can be...Ah! Good thinking, should definitely be added. I might have to add drop loot too, as seems most people don't even bother with this system because it doesn't have it... just so many ways to do it... Could go with random, could be tier based, ect.
Exactly! I was telling my buddy the same thing, people just don't realize, it was left in the perfect state for modifying to fit almost anyones personal ambitions for a system like this! Man, I really appreciate that someone can see thatimagine how amazing and personalized this system can be
I'm at work right now, so I can look more into it later, but unless otserv br used onEquip before isCheck was added, or removed it, should work fine, but I still need to see the version you are working on, because last time you posted about an error that couldn't possibly be an error for that line, unless you altered, so I will need to see your altered version to helpThe premium and level requirements dont work for me, and dont show any errors
I am not using otservbr, i am testing it on tfs 1.3 GitHub - otland/forgottenserver: A free and open-source MMORPG server emulator written in C++ (https://github.com/otland/forgottenserver)I'm at work right now, so I can look more into it later, but unless otserv br used onEquip before isCheck was added, or removed it, should work fine, but I still need to see the version you are working on, because last time you posted about an error that couldn't possibly be an error for that line, unless you altered, so I will need to see your altered version to help
I do on otservbr
Otservbr dont support eventcallback
i dont know what is the real version of my tfsNow you are saying you aren't using otservbr??? Well, I still need to see the version you are using to help with errors, as the version I released works out of the box with latest 1.3
when you start the server, in the console at the top, should tell you which version you are using, but I also need to see the script you are using, as mine doesn't line up with yours on the lines...i dont know what is the real version of my tfs
As it has been pointed out to me, otservbr doesn't have CONDITION_EXHAUST_WEAPON, so if you get a nil value at line 114, just delete lines 114, 115, and 116. As for the premium requirements, as well as vocations, it has been pointed out to me where the problem is, and I will have the main post updated with the fixes by monday. So if you want to wait, I will have an updated version for you, and then you can just delete those three lines I mentioned and should be working fine, ofc, if you are using otservbr and they also don't have event call back for onLook, then you will need to delete that entire chunk (entire function) of code and should still work fine
Hello, I have days looking at your code, I decided to try, I have read the previous comments, and I agree that it is a wonderful system, it has many uses.As it has been pointed out to me, otservbr doesn't have CONDITION_EXHAUST_WEAPON, so if you get a nil value at line 114, just delete lines 114, 115, and 116. As for the premium requirements, as well as vocations, it has been pointed out to me where the problem is, and I will have the main post updated with the fixes by monday. So if you want to wait, I will have an updated version for you, and then you can just delete those three lines I mentioned and should be working fine, ofc, if you are using otservbr and they also don't have event call back for onLook, then you will need to delete that entire chunk (entire function) of code and should still work fine
Edit : Update
Had some things come up this weekend, will have to try to get the updates done by next monday instead of tomorrow
["criticalhitchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE,},
["criticalhitamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT,},
["lifeleechchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_LIFELEECHCHANCE,},
["lifeleechamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_LIFELEECHAMOUNT,},
["manaleechchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_MANALEECHCHANCE,},
["manaleechamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SPECIALSKILL_MANALEECHAMOUNT,},
["criticalhitchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_CRITICAL_HIT_CHANCE,},
["criticalhitamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_CRITICAL_HIT_DAMAGE,},
["lifeleechchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_LIFE_LEECH_CHANCE,},
["lifeleechamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_LIFE_LEECH_AMOUNT,},
["manaleechchance"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_MANA_LEECH_CHANCE,},
["manaleechamount"] = {type = CONDITION_ATTRIBUTES, param = CONDITION_PARAM_SKILL_MANA_LEECH_AMOUNT,},
doTargetCombat(attacker:getId(), attacker, primaryType, reflectDamage, reflectDamage, CONST_ME_NONE)
doTargetCombatHealth(player, attacker, primaryType, -reflectDamage, -reflectDamage, refs[primaryType])
local refs = {
[COMBAT_PHYSICALDAMAGE] = CONST_ME_DRAWBLOOD,
[COMBAT_ENERGYDAMAGE] = CONST_ME_ENERGYAREA,
[COMBAT_EARTHDAMAGE] = CONST_ME_POISONAREA,
[COMBAT_FIREDAMAGE] = CONST_ME_FIREAREA,
[COMBAT_ICEDAMAGE] = CONST_ME_ICEAREA,
[COMBAT_HOLYDAMAGE] = CONST_ME_HOLYAREA,
[COMBAT_DEATHDAMAGE] = CONST_ME_MORTAREA
}
<equip primary="death" percent="100" />
<equip secondary="death" percent="100" />
if primePercent ~= 0 then
primaryDamage = (primaryDamage/100) * primePercent
end
if secondPercent ~= 0 then
secondPercent = (primaryDamage/100) * primePercent
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
local extra_loot = {
{hasName = "troll", items = {
{id = 2380, chance = 40000} -- 40% (hand axe, 23801/23802/23803/etc... --> custom hand axe)
--{id = 2160, countMax = 4, chance = 10000}
}},
}
function Container:addExtraLoot(c, t)
if t.hasName then
local cn = c:getName():lower()
local cm = t.hasName:lower()
if not cn:match(cm) then
return true
end
end
for i = 1, #t.items do
local count = 1
if t.items[i].count then
if t.items[i].countMax then
count = math.random(t.items[i].count, t.items[i].countMax)
else
count = t.items[i].count
end
else
if t.items[i].countMax then
count = math.random(1, t.items[i].countMax)
end
end
if math.random(0, 100000) <= t.items[i].chance then
self:addItem(t.items[i].id, count)
-- Here i would like to convert the item the custom variant (Item:getCustomEquipId()) I think? but not sure.
end
end
end
function onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if not creature:isMonster() then return true end
if corpse and corpse:isContainer() then
for i = 1, #extra_loot do
corpse:addExtraLoot(creature, extra_loot[i])
end
end
return true
end
add above local healthEvent = CreatureEvent("HealthProcessor") (line 199)
Other Error in reflect:
i recived:
player:say("reflecting"
i change to:
if secondPercent ~= 0 then
secondPercent = (secondaryDamage/100) * primePercent
end
You are right, something like that could be added! This is what is considered an enhancement though, not really an optimization, but its definitely something I would have thought someone would have contributed by now, as I'm sure most players and users would prefer to be able to see all that the equipment has, in-game.and so far it is what I have tried of your code, it can be optimized much more
You can add something like:
onEquip and deEquip
onEquip text all atributtes
Yes absolutely possible! I'm actually working on droploot right now! I absolutely love that you are making custom functions to use, did you get an error?I've been tinkering around with this, and the script seems to work perfect.
Within the suggested example and function on giving an item to a player.
I've tried to use this in combination with custom loot so that in rare occasions a custom equipment (as like a legendary or what not).
(so basically not immediately to a player but first in the slain body)
But sadly I'm a bit stuck.
for the loot script it goes like this with my idea behind it, but that's all there is now:
Lua:local extra_loot = { {hasName = "troll", items = { {id = 2380, chance = 40000} -- 40% (hand axe, 23801/23802/23803/etc... --> custom hand axe) --{id = 2160, countMax = 4, chance = 10000} }}, } function Container:addExtraLoot(c, t) if t.hasName then local cn = c:getName():lower() local cm = t.hasName:lower() if not cn:match(cm) then return true end end for i = 1, #t.items do local count = 1 if t.items[i].count then if t.items[i].countMax then count = math.random(t.items[i].count, t.items[i].countMax) else count = t.items[i].count end else if t.items[i].countMax then count = math.random(1, t.items[i].countMax) end end if math.random(0, 100000) <= t.items[i].chance then self:addItem(t.items[i].id, count) -- Here i would like to convert the item the custom variant (Item:getCustomEquipId()) I think? but not sure. end end end function onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) if not creature:isMonster() then return true end if corpse and corpse:isContainer() then for i = 1, #extra_loot do corpse:addExtraLoot(creature, extra_loot[i]) end end return true end
You think what I have in mind is easily possible?
@Codinablack
Ohh I'll await your results, cause that looks more like what i want.Let me start off by saying, hells yeah bro! You definitely did some work on this thing! I am happy to have you helping for the people who still choose to use otservbr, at least they will have a version that is usable! I absolutely appreciate all your effort and sharing!
This part, where you add the animations, I will add to the main script, this is a definite enhancement!
The part about lifeleech, crit, and manaleech, would probably never have been fixed, as I had no clue they didn't use the same enums.
I added that as a way to know it was working, its not an error, can easily be removed or kept.
Did you ever figure out the reason why manashield isn't working? How did you test, vs a monster or vs another player? If vs another player, did they also wear the custom equipment?
This was definitely a bug! Thanks for finding it! It was from a copy paste error that I apparently overlooked! Nice find!
You are right, something like that could be added! This is what is considered an enhancement though, not really an optimization, but its definitely something I would have thought someone would have contributed by now, as I'm sure most players and users would prefer to be able to see all that the equipment has, in-game.
@beenii if you have your copy with all these edits/fixes, and its working great on otservbr, if you share with me, I will update main post to include your version, just share on the thread and I'll add a link in the main post for users seeking otservbr version, with your credits
Post automatically merged:
Yes absolutely possible! I'm actually working on droploot right now! I absolutely love that you are making custom functions to use, did you get an error?
The way I'm going to do it, is by using the actually event onDropLoot. The version I will develop, will change one of the items in the loot, to match its custom version in the xml. Say, your hand axe for example, if the troll drops a hand axe, then it will have a chance to change the handaxe into one of your custom versions, the higher the tier, the harder it will be to get it. I'm adding in tiers, but they aren't necessary, and as you have dabbled, you can see, there are so many ways to do the same thing, so since you are pretty good with lua, I'm certain you will definitely appreciate the next release , that forreal should be done by monday at the latest this time
I'm so happy to see people actually using it and also editing it! You all make me happy
count on me@beenii if you have your copy with all these edits/fixes, and its working great on otservbr, if you share with me, I will update main post to include your version, just share on the thread and I'll add a link in the main post for users seeking otservbr version, with your credits
Post automatically merged:
Sarah has already shared with me the fix for both the premium, and getting vocations to read for multiple instancescount on me
I will see between today and tomorrow if I solve the manashield condition, Although I consider it is not very important, and I will correct the premium tag, and then I will publish the version for otservbr.
If you like, send me your discord in private, to see what improvements we will add in the future to the 2 versions.
Best regards
["vocation"] = i:match('vocation.-=.-"(.-)"'), -- Example: vocation="1" | Example: vocation="1,5,6"
}
-- Vocation list to number
local vocations = requirements["vocation"]
if vocations then
local split = vocations:split(",")
requirements["vocation"] = {}
for _, id in pairs(split) do
table.insert(requirements["vocation"], tonumber(id) or 0)
end
end
----------------------------------------------------
if #eq.requirements["vocation"] > 0 then
description = string.format("%s\nVocation Required: " ..table.concat(eq.requirements["vocation"], ', ').. "", description)
end
if eq.requirements["premium"] and eq.requirements["premium"] > 0 then
if player:getPremiumTime() == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR,"You must have premium to equip that item!")
return false
end
end
if #eq.requirements["vocation"] > 0 then
if not table.contains(eq.requirements["vocation"], player:getVocation():getId()) then
player:sendTextMessage(MESSAGE_INFO_DESCR,"You don't have the proper vocation to equip that item!")
return false
end
end