[Warning - Events::load] Can not load script: creature.lua
data/events/scripts/creature.lua:5: '<name>' expected near 'function'
>> Loading monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 2048x2048.
> Map loading time: 1.267 seconds.
> Loaded house items in: 0 s
>> Initializing gamestate
>> Loaded all modules, server starting up...
>> Valhalla Server Online!
function Creature
nTargetCombat(target)
return stat_onTargetCombat(self, target)
end
function function Creature
nChangeOutfit(outfit)
return local hp = Condition(CONDITION_ATTRIBUTES)
hp:setParameter(CONDITION_PARAM_TICKS, -1)
hp:setParameter(CONDITION_PARAM_SUBID, 100)
hp:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 2000)
local distance = Condition(CONDITION_ATTRIBUTES)
distance:setParameter(CONDITION_PARAM_TICKS, -1)
distance:setParameter(CONDITION_PARAM_SUBID, 101)
distance:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150)
local sword = Condition(CONDITION_ATTRIBUTES)
sword:setParameter(CONDITION_PARAM_TICKS, -1)
sword:setParameter(CONDITION_PARAM_SUBID, 102)
sword:setParameter(CONDITION_PARAM_SKILL_SWORDPERCENT, 150)
oldOutfit = {}
outfitBonuses = {
[128] = {[1] = {condition = distance}, [2] = {condition = sword}, [3] = {condition = hp}},
[129] = {[3] = {condition = hp}},
[289] = {[3] = {condition = {distance, sword, hp}}}
}
function Creature
nChangeOutfit(outfit)
if self:isPlayer() then
local getOutfit = self:getOutfit()
oldOutfit[self:getId()] = { --Colors (Head, Body, Legs, Feet) and lookTypeEx are unused, but I still keep them here because I'm stupid.
lookHead = getOutfit.lookHead;
lookBody = getOutfit.lookBody;
lookLegs = getOutfit.lookLegs;
lookFeet = getOutfit.lookFeet;
lookType = getOutfit.lookType;
lookTypeEx = getOutfit.lookTypeEx;
lookAddons = getOutfit.lookAddons;
lookMount = getOutfit.lookMount;
}
local old = oldOutfit[self:getId()]
local oldOutfit_t = outfitBonuses[old.lookType]
if oldOutfit_t and oldOutfit_t[old.lookAddons] then
local oldCondition = oldOutfit_t[old.lookAddons].condition
if type(oldCondition) == "table" then
for _, condition in pairs(oldCondition) do
self:removeCondition(condition:getType(), condition:getId(), condition:getSubId())
end
else
self:removeCondition(oldCondition:getType(), oldCondition:getId(), oldCondition:getSubId())
end
end
local currentOutfit = outfitBonuses[outfit.lookType]
if currentOutfit and currentOutfit[outfit.lookAddons] then
local newCondition = currentOutfit[outfit.lookAddons].condition
if type(newCondition) == "table" then
for _, condition in pairs(newCondition) do
self:addCondition(condition)
end
else
self:addCondition(newCondition)
end
end
end
return true
end
return true
end
function Creature
nAreaCombat(tile, isAggressive)
return true
end
function Creature
nTargetCombat(target)
return true
end
ANY ideas?