Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 625
- Reaction score
- 71
Hello so trying to add event points as a reward and items with chance to get it and without chance just a simple item give. So i will show what i got so far
TFS 1.2
Usage is
pointsReward = 5,
itemReward = 14681,15 (dont know about this itemReward either it looks stupid)
in global.lua i would add these inside this table
TFS 1.2
LUA:
function onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
local myEvent = 25335 -- event points storage
local percent = creature:getMaxHealth() * 0.02
for k, v in pairs(monsterSystem) do
if v.name:lower() == creature:getName():lower() then
for pid, info in pairs(creature:getDamageMap()) do
local player = Player(pid)
if player and info.total >= percent then
player:addExperience(v.expReward, true)
player:addMoney(v.goldReward)
player:addEventPoints(myEvent, v.pointsReward) -- So this is event points
player:addItem(v.itemReward) -- this is adds items dont know about amount
-- and dont know how to make to add item with 15% chance to get it
-- not even sure if my added code would work
end
end
end
end
stopEvent(henkasEventOne)
return true
end
Usage is
pointsReward = 5,
itemReward = 14681,15 (dont know about this itemReward either it looks stupid)
in global.lua i would add these inside this table
LUA:
monsterSystem = {
[1] = {name = "Worm Boss", pos = Position(228, 1043, 7), expReward = 1500, goldReward = 10, msg = "Boss spawned. Test!"}
}