Nuckles
New Member
- Joined
- Mar 19, 2010
- Messages
- 39
- Reaction score
- 0
This script:
This script giving ML for Knight.
I did not understand his organization and therefore can not corrigr.
Someone can put condition for vocations? To knight not receive ML , mage not receive skill and etc.
Thanks!
Code:
local knight = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(knight, CONDITION_PARAM_TICKS, -1)
setConditionParam(knight, CONDITION_PARAM_STAT_MAGICLEVEL, -2)
local mage = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(mage, CONDITION_PARAM_TICKS, -1)
setConditionParam(mage, CONDITION_PARAM_STAT_MAGICLEVEL, 2)
local assassin = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(assassin, CONDITION_PARAM_TICKS, -1)
setConditionParam(assassin, CONDITION_PARAM_SKILL_DISTANCE, 5)
--- CONDITION_PARAM_STAT_MAXHEALTH, CONDITION_PARAM_STAT_MAXMANA
--- CONDITION_PARAM_BUFF
outfitBonusTable = { --- [] = {condition = , typ = }
[130] = {condition = knight, typ = CONDITION_ATTRIBUTES}, [138] = {condition = knight, typ = CONDITION_ATTRIBUTES}, --Mage
[134] = {condition = knight, typ = CONDITION_ATTRIBUTES}, [142] = {condition = knight, typ = CONDITION_ATTRIBUTES}, --Warrior
[144] = {condition = mage, typ = CONDITION_ATTRIBUTES}, [148] = {condition = mage, typ = CONDITION_ATTRIBUTES}, --Druid
[152] = {condition = assassin, typ = CONDITION_ATTRIBUTES}, [156] = {condition = assassin, typ = CONDITION_ATTRIBUTES} --Assassin}
}
function onLogin(cid)
registerCreatureEvent(cid, "Addons")
--- local current = getCreatureOutfit(cid)
return onOutfit(cid, {lookAddons = 1}, getCreatureOutfit(cid)) and true
end
function onOutfit(cid, old, current)
if getPlayerAccess(cid) >= 3 then
return print("Staff/support can't get any addon bonus!") and true
end
if old.lookAddons == 3 and outfitBonusTable[old.lookType] then --Bonus off
if (outfitBonusTable[old.lookType]).typ ~= nil then
if type((outfitBonusTable[old.lookType]).typ) == "table" then
for _, value in pairs((outfitBonusTable[old.lookType]).typ) do
doRemoveCondition(cid, value)
end
else
doRemoveCondition(cid, (outfitBonusTable[old.lookType]).typ)
end
end
end
if current.lookAddons == 3 and outfitBonusTable[current.lookType] then --Bonus on
if (outfitBonusTable[current.lookType]).condition ~= nil then
if type((outfitBonusTable[current.lookType]).condition) == "table" then
for _, value in pairs((outfitBonusTable[current.lookType]).condition) do
doAddCondition(cid, value)
end
else
doAddCondition(cid, (outfitBonusTable[current.lookType]).condition)
end
end
end
return true
end
This script giving ML for Knight.
I did not understand his organization and therefore can not corrigr.
Someone can put condition for vocations? To knight not receive ML , mage not receive skill and etc.
Thanks!