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

Sir Islam

Never Give Up
Joined
Jun 6, 2008
Messages
504
Best answers
1
Reaction score
118
Location
Suez , Egypt
"you can not use this object"
just delete this line from stats.lua http://pastebin.com/cD17xq1S
Code:
if not(Item(target) or Creature(target)) then return false end
at line 1236

then make this
Slot.lua
Code:
function onUse(player, item, fromPosition, itemEx, toPosition)
if not (Item(itemEx.uid) or not Creature(itemEx.uid)) or itemEx.itemid == 2173 then return false end
stat_onUse(player, item, fromPosition, itemEx, toPosition)
return true
end
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
just delete this line from stats.lua http://pastebin.com/cD17xq1S
Code:
if not(Item(target) or Creature(target)) then return false end
at line 1236

then make this
Hiho Sir, its working almost flawless,

Code:
Lua Script Error: [Action Interface]

data/actions/scripts/slot.lua:onUse
data/stats.lua:1239: attempt to call method 'isItem' (a nil value)
stack traceback:
        [C]: in function 'isItem'
        data/stats.lua:1239: in function 'stat_onUse'
        data/stats.lua:1446: in function 'stat_onUse'
        data/actions/scripts/slot.lua:3: in function <data/actions/scripts/slot.lua:1>
[edit]About the problem above, just removed the line and its okay.. and removed -- from line 1445 so player now will know whats going on.. is about duplicate item..

twas like this
Code:
                                --player:sendTextMessage(MESSAGE_INFO_DESCR, "Duplicate stat, try again.")
                                stat_onUse(player, item, fromPosition, itemEx, toPosition, attempt + 1)
and i just changed to this
Code:
                                player:sendTextMessage(MESSAGE_INFO_DESCR, "Duplicate stat, try again.")
                                --stat_onUse(player, item, fromPosition, itemEx, toPosition, attempt + 1)
//
Also if i remove an item all stats are re-set, not back to original, its just like a click.. it returns to back and reset all again..

Ex.: base stats mana 100, with equipment mp+450 = 550, if i remove any equipment it will make mana back to 100 maintaining the 500, imagine in a hunt u need to put a ssa and your mana/hp goes down for this action? :p

Quick video about the problem
just sharing the bugs that i've found[/edit]

last but not least im very glad for the help.. thanks alot :D once more :)
 
Last edited:

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
Please don't post stuff like that. People think they can guilt a person into helping them, but in reality it is more of a deterrent than motivation.
Well 1st i didnt meant that.. i dont want to be rude, dont get like it but before saying things try to know what is the real meaning.. dont intended to .. was just sharing a view.. its a good system and he may be busy thats why he cant be here helping.. its really sad.. if being busy isnt the real reason.. well good thing that the place is plenty of skilled ppl who can do it instead..

so please dont be mad on me nor try to pretend know what is the real meaning fo a thing just cuz u think that ure right about or so.. im a noob about things still in learn so by know my best is try ask why, how, and when i really cant do by myself (most of times) i ask for help..

the worst part in post something is that others may not understand in right way.. you cant hear the voice, the way that the 'person' say things helps to understand .. once again i never meant to, nor meant to be rude.. so dont get me in this way :)

:)
 

Wafel1337

New Member
Joined
Aug 27, 2009
Messages
6
Best answers
0
Reaction score
1
Hello, is it possible to make create item with specific atributtes already? Like as the reward from quest someone gets Lifesteal sword??
 

Codinablack

Dreamer
Joined
Dec 26, 2013
Messages
1,217
Best answers
4
Reaction score
373
Hello, is it possible to make create item with specific atributtes already? Like as the reward from quest someone gets Lifesteal sword??
Yes, that is the whole point in this system is to create items with attributes, doesn't matter how they are created....
 

Wafel1337

New Member
Joined
Aug 27, 2009
Messages
6
Best answers
0
Reaction score
1
Thanks for your answer :) can you maybe make some example how to make an item with static attributes which than I can make as reward for quest?
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
Yes, that is the whole point in this system is to create items with attributes, doesn't matter how they are created....
i think the guy mean that he wants to create a item like /i with attributes already set on it..
maybe a script that makes the item get attributes when onUse a reward chest, so peoplo could get a good item from a hard quest w/o having to try get from loot nor using stones..

Would be a great feature anyway.. Idont know how it work but im prety sure that he meant like that

The system is perfect already anyway
 

Wafel1337

New Member
Joined
Aug 27, 2009
Messages
6
Best answers
0
Reaction score
1
i think the guy mean that he wants to create a item like /i with attributes already set on it..
maybe a script that makes the item get attributes when onUse a reward chest, so peoplo could get a good item from a hard quest w/o having to try get from loot nor using stones..

Would be a great feature anyway.. Idont know how it work but im prety sure that he meant like that

The system is perfect already anyway
Yea that's exactly what I wanted to say :) I can't use stones because of "You can't use this object." and I wanted to stay with lootable sloted with no upgrades with low chance and wanted to make some predefined items with slots as reward for quests or some weak sloted items as starting shit :)
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
Yea that's exactly what I wanted to say :) I can't use stones because of "You can't use this object." and I wanted to stay with lootable sloted with no upgrades with low chance and wanted to make some predefined items with slots as reward for quests or some weak sloted items as starting shit :)
About this problem "you cant use" if you read previous post you'll find a way to fix.. i was having the same problem.. then Sir Islam helped me with.. but would be kool being able to set in someway the item to use as quest reward..
 

Wafel1337

New Member
Joined
Aug 27, 2009
Messages
6
Best answers
0
Reaction score
1
Yea I just fixed it :) so at this moment it's impossible to get items with attributes as quest reward or as firstitems?
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
Yea I just fixed it :) so at this moment it's impossible to get items with attributes as quest reward or as firstitems?
Since theres no way to setup the attr to item i guess not..

i dont think its a hard thing to do.. since the system is there.. i just dont know how.. but sure it can be done for someone who understand the system and lua coding
 

Wafel1337

New Member
Joined
Aug 27, 2009
Messages
6
Best answers
0
Reaction score
1
Maybe someone will help us with that :) I am LowBOB so I can't do this alone with my actual skills
 

Codinablack

Dreamer
Joined
Dec 26, 2013
Messages
1,217
Best answers
4
Reaction score
373
There are functions in this library that all you have to do is use them in a movement, creaturescript, action, talkaction, ect. to make custom items however you want. I would suggest action script obviously if you want to make it a quest item.
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
There are functions in this library that all you have to do is use them in a movement, creaturescript, action, talkaction, ect. to make custom items however you want. I would suggest action script obviously if you want to make it a quest item.
We know man.. but you must remember we are pro like you nor others.. even trying to manage based in others scripts it would be like hell to us.. once again i dont mean to be rude.. but if u dont wanna help why do this kind of post.. you're just saying the same as i did.. instead being like others.. give some tip or so.. saying something taht we already know isnt to help.. yourent being construtive nor critic .. just being like those kids who use to say "face it up"

"i dont think its a hard thing to do.. since the system is there.. i just dont know how.. but sure it can be done for someone who understand the system and lua coding"

i know theres a way do to.. we just dont know how..
 

dkangel83

Member
Joined
Mar 31, 2010
Messages
102
Best answers
0
Reaction score
8
Location
Brazil
You can assign attributes to an item by using the method Item.generateStats. There are two examples between L2731-2745.
Thanks for.. i didnt paid any attention to that part when i saw cuz i though twas part of older tfs compatibility code. twas a fast reading.. really my bad..

anyway you came to give the tip about where we could find.. thanks for.. sorry for any trouble in your topic.. :) dont want ppl to look at me as trouble maker cuz i dont .. once again im in learning .. i just need to pay better attention to things..

Im really glad for your support

Regards
DeCarvalho
 

Leo32

Getting back into it...
Joined
Sep 21, 2007
Messages
724
Best answers
1
Reaction score
121
Next step would be having the affixes appear in the monster loot list message.
Code already exists for 0.4, will convert myself and post later.

If anyone has done it already, I'd appreciate a link!
 

daiver

New Member
Joined
Oct 22, 2008
Messages
23
Best answers
0
Reaction score
3
Good, as you can put the upgrade in percentage?

Example: You see a giant sword (Atk: 46, Def: 22).
You see a giant sword + 5 (Atk: 61, Def: 32).

Acutalmente is this: You see a giant sword (Atk: 46, Def: 22).
You see a legendary giant sword +5 (Atk: 71, Def: 47).

This is for that rises from 5 to 5 and not by percentage, how could ahcer for every slight turn up the item, not 5 atack if 5% + of attack as in the first example? ...

In advance thank you very much, excuse my English, I'm Spanish :(
 
Top