• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux CreatureScripts, Addon Bonus

Nuckles

New Member
Joined
Mar 19, 2010
Messages
39
Reaction score
0
This script:
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!
 
Script have local you can edit conditions or is better why you only not added functions in outfits.xml?
Lua:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
        <list gender="1" lookType="128" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
    </outfit>
 
    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter">
        <skills dist="3"/>
        </list>
        <list gender="1" lookType="129" name="Hunter">
        <skills dist="3"/>
        </list>
    </outfit>
 
    <outfit id="3">
        <list gender="0" lookType="138" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
        <list gender="1" lookType="130" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
    </outfit>
 
    <outfit id="4">
        <list gender="0" lookType="139" name="Knight">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="131" name="Knight">
        <skills sword="3"/>
        </list>
    </outfit>
 
    <outfit id="5" premium="no">
        <list gender="0" lookType="140" name="Noblewoman">
        <skills club="3"/>
        </list>
        <list gender="1" lookType="132" name="Nobleman">
        <skills club="3"/>
        </list>
    </outfit>
 
    <outfit id="6" premium="no">
        <list gender="0" lookType="141" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="133" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="7" premium="no">
        <list gender="0" lookType="142" name="Warrior">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="134" name="Warrior">
        <skills sword="3"/>
        </list>
    </outfit>
 
    <outfit id="8" premium="no">
        <list gender="0" lookType="147" name="Barbarian">
        <skills axe="3"/>
        </list>
        <list gender="1" lookType="143" name="Barbarian">
        <skills axe="3"/>
        </list>
    </outfit>
 
    <outfit id="9" premium="no">
        <list gender="0" lookType="148" name="Druid">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="144" name="Druid">
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="10" premium="no">
        <list gender="0" lookType="149" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="145" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="11" premium="no">
        <list gender="0" lookType="150" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
        <list gender="1" lookType="146" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
    </outfit>
 
    <outfit id="12" premium="no">
        <list gender="0" lookType="155" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
        <list gender="1" lookType="151" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
    </outfit>
 
    <outfit id="13" premium="no" >
        <list gender="0" lookType="156" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
        <list gender="1" lookType="152" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
    </outfit>
 
    <outfit id="14" premium="no" >
        <list gender="0" lookType="157" name="Beggar">
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="153" name="Beggar">
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="15" premium="no" >
        <list gender="0" lookType="158" name="Shaman">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="154" name="Shaman">
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="16" premium="no" >
        <list gender="0" lookType="252" name="Norsewoman">
        <skills shielding="2"/>
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="251" name="Norseman">
        <skills shielding="2"/>
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="17" premium="no" >
        <list gender="0" lookType="269" name="Nightmare">
        <skills shielding="8"/>
        </list>
        <list gender="1" lookType="268" name="Nightmare">
        <skills shielding="8"/>
        </list>
    </outfit>
 
    <outfit id="18" premium="no">
        <list gender="0" lookType="270" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="273" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
    </outfit>
 
    <outfit id="19" premium="yes" >
        <list gender="0" lookType="279" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
        <list gender="1" lookType="278" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
    </outfit>
 
    <outfit id="20" premium="yes" >
        <list gender="0" lookType="288" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="289" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="21" premium="yes" >
        <list gender="0" lookType="324" name="Yalaharian">
        <attribute speed="5"/>
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="325" name="Yalaharian">
        <attribute speed="5"/>
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="22" premium="yes">
        <list gender="0" lookType="336" name="Warmaster">
        <stats maxMana="100"/>
        <attribute speed="15"/>
        <stats maxHealth="100"/>
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="335" name="Warmaster">
        <stats maxMana="100"/>
        <attribute speed="15"/>
        <stats maxHealth="100"/>
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="23" premium="yes">
        <list gender="0" lookType="366" name="Wayfarer">
	       <attribute speed="15"/>
        	<skills dist="5"/>
	 </list>
        <list gender="1" lookType="367" name="Wayfarer">
	       <attribute speed="15"/>
        	<skills dist="5"/>
	 </list>
    </outfit>
 
    <outfit id="24" premium="no" >
        <list gender="0" lookType="329" name="Wedding"/>
        <list gender="1" lookType="328" name="Wedding"/>
    </outfit>
 
    <outfit id="25" premium="yes" access="5"> <!-- storageId="20000" storageValue="1"-->
        <list gender="0-3" lookType="159" name="Elf"/>
    </outfit>
 
    <outfit id="26" premium="yes" access="5"> <!-- storageId="21000" storageValue="1"-->
        <list gender="0-3" lookType="160" name="Dwarf"/>
    </outfit>
 
    <outfit id="27" premium="yes" access="5"> <!-- storageId="22000" storageValue="1"-->
        <list gender="0-3" lookType="226" name="Frog"/>
    </outfit>
 
    <outfit id="28" premium="yes" access="5"> <!-- storageId="23000" storageValue="1"-->
        <list gender="0-3" lookType="194" name="Cult"/>
    </outfit>
 
    <outfit id="29" premium="yes" access="5"> <!-- storageId="24000" storageValue="1"-->
        <list gender="0-3" lookType="253" name="Headsplitter"/>
    </outfit>
 
    <outfit id="30" premium="yes" access="5"> <!-- storageId="25000" storageValue="1"-->
        <list gender="0-3" lookType="254" name="Skullhunter"/>
    </outfit>
 
    <outfit id="31" premium="yes" access="5"> <!-- storageId="26000" storageValue="1"-->
        <list gender="0-3" lookType="255" name="Bloodwalker"/>
    </outfit>
 
    <outfit id="32" premium="yes" access="5"> <!-- storageId="27000" storageValue="1"-->
        <list gender="0-3" lookType="264" name="Brutetamer"/>
    </outfit>
 
    <outfit id="34" access="3" premium="no">
        <list gender="0-3" lookType="75" name="Gamemaster"/>
    </outfit>
 
    <outfit id="35" access="4" premium="no">
        <list gender="0-3" lookType="266" name="Community Manager"/>
    </outfit>
 
    <outfit id="36" access="5" premium="no">
        <list gender="0-3" lookType="302" name="God"/>
    </outfit>
</outfits>

Only edit skills for each outfit
 
Script have local you can edit conditions or is better why you only not added functions in outfits.xml?
Lua:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
        <list gender="1" lookType="128" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
    </outfit>
 
    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter">
        <skills dist="3"/>
        </list>
        <list gender="1" lookType="129" name="Hunter">
        <skills dist="3"/>
        </list>
    </outfit>
 
    <outfit id="3">
        <list gender="0" lookType="138" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
        <list gender="1" lookType="130" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
    </outfit>
 
    <outfit id="4">
        <list gender="0" lookType="139" name="Knight">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="131" name="Knight">
        <skills sword="3"/>
        </list>
    </outfit>
 
    <outfit id="5" premium="no">
        <list gender="0" lookType="140" name="Noblewoman">
        <skills club="3"/>
        </list>
        <list gender="1" lookType="132" name="Nobleman">
        <skills club="3"/>
        </list>
    </outfit>
 
    <outfit id="6" premium="no">
        <list gender="0" lookType="141" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="133" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="7" premium="no">
        <list gender="0" lookType="142" name="Warrior">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="134" name="Warrior">
        <skills sword="3"/>
        </list>
    </outfit>
 
    <outfit id="8" premium="no">
        <list gender="0" lookType="147" name="Barbarian">
        <skills axe="3"/>
        </list>
        <list gender="1" lookType="143" name="Barbarian">
        <skills axe="3"/>
        </list>
    </outfit>
 
    <outfit id="9" premium="no">
        <list gender="0" lookType="148" name="Druid">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="144" name="Druid">
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="10" premium="no">
        <list gender="0" lookType="149" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="145" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="11" premium="no">
        <list gender="0" lookType="150" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
        <list gender="1" lookType="146" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
    </outfit>
 
    <outfit id="12" premium="no">
        <list gender="0" lookType="155" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
        <list gender="1" lookType="151" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
    </outfit>
 
    <outfit id="13" premium="no" >
        <list gender="0" lookType="156" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
        <list gender="1" lookType="152" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
    </outfit>
 
    <outfit id="14" premium="no" >
        <list gender="0" lookType="157" name="Beggar">
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="153" name="Beggar">
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="15" premium="no" >
        <list gender="0" lookType="158" name="Shaman">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="154" name="Shaman">
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="16" premium="no" >
        <list gender="0" lookType="252" name="Norsewoman">
        <skills shielding="2"/>
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="251" name="Norseman">
        <skills shielding="2"/>
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="17" premium="no" >
        <list gender="0" lookType="269" name="Nightmare">
        <skills shielding="8"/>
        </list>
        <list gender="1" lookType="268" name="Nightmare">
        <skills shielding="8"/>
        </list>
    </outfit>
 
    <outfit id="18" premium="no">
        <list gender="0" lookType="270" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="273" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
    </outfit>
 
    <outfit id="19" premium="yes" >
        <list gender="0" lookType="279" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
        <list gender="1" lookType="278" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
    </outfit>
 
    <outfit id="20" premium="yes" >
        <list gender="0" lookType="288" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="289" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="21" premium="yes" >
        <list gender="0" lookType="324" name="Yalaharian">
        <attribute speed="5"/>
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="325" name="Yalaharian">
        <attribute speed="5"/>
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="22" premium="yes">
        <list gender="0" lookType="336" name="Warmaster">
        <stats maxMana="100"/>
        <attribute speed="15"/>
        <stats maxHealth="100"/>
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="335" name="Warmaster">
        <stats maxMana="100"/>
        <attribute speed="15"/>
        <stats maxHealth="100"/>
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="23" premium="yes">
        <list gender="0" lookType="366" name="Wayfarer">
	       <attribute speed="15"/>
        	<skills dist="5"/>
	 </list>
        <list gender="1" lookType="367" name="Wayfarer">
	       <attribute speed="15"/>
        	<skills dist="5"/>
	 </list>
    </outfit>
 
    <outfit id="24" premium="no" >
        <list gender="0" lookType="329" name="Wedding"/>
        <list gender="1" lookType="328" name="Wedding"/>
    </outfit>
 
    <outfit id="25" premium="yes" access="5"> <!-- storageId="20000" storageValue="1"-->
        <list gender="0-3" lookType="159" name="Elf"/>
    </outfit>
 
    <outfit id="26" premium="yes" access="5"> <!-- storageId="21000" storageValue="1"-->
        <list gender="0-3" lookType="160" name="Dwarf"/>
    </outfit>
 
    <outfit id="27" premium="yes" access="5"> <!-- storageId="22000" storageValue="1"-->
        <list gender="0-3" lookType="226" name="Frog"/>
    </outfit>
 
    <outfit id="28" premium="yes" access="5"> <!-- storageId="23000" storageValue="1"-->
        <list gender="0-3" lookType="194" name="Cult"/>
    </outfit>
 
    <outfit id="29" premium="yes" access="5"> <!-- storageId="24000" storageValue="1"-->
        <list gender="0-3" lookType="253" name="Headsplitter"/>
    </outfit>
 
    <outfit id="30" premium="yes" access="5"> <!-- storageId="25000" storageValue="1"-->
        <list gender="0-3" lookType="254" name="Skullhunter"/>
    </outfit>
 
    <outfit id="31" premium="yes" access="5"> <!-- storageId="26000" storageValue="1"-->
        <list gender="0-3" lookType="255" name="Bloodwalker"/>
    </outfit>
 
    <outfit id="32" premium="yes" access="5"> <!-- storageId="27000" storageValue="1"-->
        <list gender="0-3" lookType="264" name="Brutetamer"/>
    </outfit>
 
    <outfit id="34" access="3" premium="no">
        <list gender="0-3" lookType="75" name="Gamemaster"/>
    </outfit>
 
    <outfit id="35" access="4" premium="no">
        <list gender="0-3" lookType="266" name="Community Manager"/>
    </outfit>
 
    <outfit id="36" access="5" premium="no">
        <list gender="0-3" lookType="302" name="God"/>
    </outfit>
</outfits>

Only edit skills for each outfit

Even with tag " <vocation id="x"/> " tags
the condition does not work for vocations. Everyone ends up getting the bonus.

Anyone have any idea?
 
Back
Top