CreatureEvent [TFS 1.1] Ultimate item stat system (elements, skills, exp, loot and more)

Zasranets

Alan
Joined
Apr 7, 2010
Messages
2,969
Reaction score
758
Location
USA
This is awesome! I'm so sick and tired of seeing that same old basic item stat system. Hope more people will start using this if it's stable.
 

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
173
Reaction score
14
Location
Sweden
Awesome work man. The loot system is truly amazing.
However, I looted a ring with this bonus: [exp.+20]
Tried it out, and it doesnt really add 20% if that is whats intended? Its adding pretty low random exp. not sure if it should work that way.
 

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
727
Reaction score
124
Location
Canada
This is awesome! I'm so sick and tired of seeing that same old basic item stat system. Hope more people will start using this if it's stable.
ill use it and thanks @zbizu its amazing even the items elements :))))
 
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
@calveron
At first I thought it'd be op to always give full amount.
Should I change that to actual value?
 

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
173
Reaction score
14
Location
Sweden
Yea, what RosOT said, it should be a fixed value, but not that high hehe.
If I want to add possibility to get exp bonus from armors for example, how do I add that?
 

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
173
Reaction score
14
Location
Sweden
There seems to be some problems with mana gain. I got this: [regMP.+10]
But while hunting, it goes bananas, either stops working or it gives alot more mana.
 
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
Yea, what RosOT said, it should be a fixed value, but not that high hehe
If I want to add possibility to get exp bonus from armors for example, how do I add that?
line 2246, above "local ring"
Code:
for k = 1, 9 do
-- code
end
in local ring replace CONST_SLOT_RING to k
go to line 108, there you will find a table with spells. Add exp stat to certain type of item

There seems to be some problems with mana gain. I got this: [regMP.+10]
But while hunting, it goes bananas, either stops working or it gives alot more mana.
does same thing happen for regHP.+x (with/without %) and regMP.+x%?
 

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
727
Reaction score
124
Location
Canada
I changed my mind you will debug if a weapon has mulitple stats of elemetns example +10 ice +20 earth it will debug you i think if you able to do it make it so only 1 element is aloud on 1 item.

I also tried it with 1 single element on a weapon still debugs :|
 
Last edited:
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
Tested it on otclient only and elements dmg worked fine. Well, I'll check this and regeneration on normal client later.

Edit: okay, I will try to do some fixes tonight.
To do:
- Add loot ring to one "if" I forgot
- fix negative values for upgraded items
- fix regeneration (it goes bananas)
- test dmg with normal client
- change exp% and dmg% to fixed values
- isPlayer for pve stat
 
Last edited:
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
first post updated, changes in script:
everything from "to do" list above was done

regeneration % may have higher values now as it uses vocation-based amount of regeneration instead of % of total player's hp/mp
 
Last edited:

Red

Cyntara Admin
Staff member
Global Moderator
Premium User
Joined
Aug 9, 2008
Messages
4,362
Reaction score
762
Location
United States
"Very impressive Zbizu"
"Thank you for the contribution"
"You're bringing life to 1.x with your contributions"
"I hope to implement your code to my server in the future"

Choose a few or all of the above as compliments!
Red
 

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
727
Reaction score
124
Location
Canada
@zbizu - :| still bugs out a bit but its working more and more each day <3 keep up the good work!
 

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
727
Reaction score
124
Location
Canada
Testing the weapon elements a bit more it seems after the third hit you start to see the element damage.

Exp: % is working fine @zbizu good job on that :)

Im not sure if that +33 was a bug and it missed to print % or if it is just to add an extra 33 exp and not a % im not sure but when the +#% is printed it works great!

Item used.
Code:
17:32 You see a legendary wedding ring.
It weighs 0.40 oz.
[death.+7%][regHP.+5][exp.+48%][ice.+6%]
Monster: Cyclops - Exp: 1125 +48% = 540 Details below
Code:
17:29 You gained 540 experience points. -- this is the added 48% of 1125
17:29 You gained 1125 experience points.
____________________________________________________________________
Line 1914! Necklace Value Nill.
-Click to view Line 1914 Function-
Code:
function stat_onPrepareDeath(creature, lastHitKiller, mostDamageKiller)
    local necklace = creature:getSlotItem(CONST_SLOT_NECKLACE)
    local slotc = necklace:getStatSlotCount()

    if not Player(lastHitKiller) then
        if slotc > 0 then
            local cur_slots = necklace:getStatSlots()
            for i = 1, slotc do
                if cur_slots[i][1] == 'PVE death' then
                    if cur_slots[i][2]:match("%%") then
                    local a, b = cur_slots[i][2]:match('([+-])(%d+)%%')
                        if math.random(1, 100) > tonumber(a..b) then
                            necklace:remove()
                            return true
                        end
                    end
                    local maxhp = creature:getMaxHealth()
                    creature:addHealth(maxhp)
                    addEvent(doCreatureAddHealth, 100, creature:getId(), maxhp)
                    creature:teleportTo(creature:getTown():getTemplePosition())
                    necklace:remove()
                    return true
                end
            end
        end
    end
return true
end
 
Last edited:
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
healing issue:
It makes you weaker for healing so healing spells are more effective on your character.
Let's say you use exura or someone sio on you for +100 and you wear item [healing.-10%], then you will receive +110 heal.

exp.+33 = random exp between 1 and 33 for killing a monster
exp.+33% = fixed value of +33% exp

okay, new to-do list(just a reference for me in fixing later):
1. test necklace/no necklace again
2. add "if" statement to not send combat while 0 dmg(combat did 0 dmg, effect had to be sent to avoid client debug)
3. check regeneration again
 

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
727
Reaction score
124
Location
Canada
healing issue:
It makes you weaker for healing so healing spells are more effective on your character.
Let's say you use exura or someone sio on you for +100 and you wear item [healing.-10%], then you will receive +110 heal.

exp.+33 = random exp between 1 and 33 for killing a monster
exp.+33% = fixed value of +33% exp

okay, new to-do list(just a reference for me in fixing later):
1. test necklace/no necklace again
2. add "if" statement to not send combat while 0 dmg(combat did 0 dmg, effect had to be sent to avoid client debug)
3. check regeneration again
Alright i get what you mean by the Exp now it works flawlessly then :)
and for the necklace error it makes you Unkillable by monsters never tested with pvp
other then that great work its amazing.

Edit: If wearing an amulet you take damage until you die so when an amulet is equiped it works.
 
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
between these lines
Code:
if not Player(lastHitKiller) then
     if slotc > 0 then
add
Code:
if necklace then
and close it with end in correct position and it should be fixed

I'll do it myself in next fix
 
OP
zbizu

zbizu

Veteran OT User
Joined
Nov 22, 2010
Messages
2,460
Reaction score
1,357
Location
Poland
oh
local slotc should be moved below "if necklace" to avoid error
 
Top