• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell Outfit Changer (for custom monster)

lokolokio

Well-Known Member
Joined
Jan 7, 2009
Messages
201
Solutions
13
Reaction score
78
Location
Mexico
I have made a spell that changes the creature random outfit once when you summon him. hope you like it. (For the moment I just added player outfits).

1: You just need to add this line to 'data/spells/spells.xml'
<instant name="outfit" words="###1" aggressive="0" blockwalls="1" needtarget="0" needlearn="1" script="outfiter.lua"/>
2: In 'outfiter.lua' add this code:

Code:
local setOutfitExh = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
setOutfitExh:setParameter(CONDITION_PARAM_SUBID, 123456)
setOutfitExh:setParameter(CONDITION_PARAM_TICKS, 86400000)
setOutfitExh:setParameter(CONDITION_PARAM_HEALTHGAIN, 0.01)
setOutfitExh:setParameter(CONDITION_PARAM_HEALTHTICKS, 86400000)
local outfitList = {128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 251, 252, 268, 269, 270, 273, 278, 279, 288, 289, 324, 325, 328, 329, 335, 336, 366, 367, 430, 431, 432, 433, 463, 464, 465, 466, 471, 472, 512, 513, 514, 516, 541, 542, 574, 575, 577, 578, 610, 618, 619, 620, 632, 633, 634, 635, 636, 637, 664, 665, 666, 667, 683, 684, 694, 695, 696, 697, 698, 699}


function onCastSpell(cid, var)
    local c = Creature(cid)
    local outfiter = math.random(1, #outfitList)
    local outfit = c:getOutfit()
    outfit.lookType = outfitList[outfiter]
    outfit.lookHead = math.random(0, 132)
    outfit.lookBody = math.random(0, 132)
    outfit.lookLegs = math.random(0, 132)
    outfit.lookFeet = math.random(0, 132)
    outfit.lookAddons = math.random(0, 3)

    if not c:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT, 123456) then
        c:setOutfit(outfit)
        c:addCondition(setOutfitExh)
    end
end
3: Put this line on each monster you want to have that spell:
<defense name="outfit" interval="1000" chance="100"/>


I Have made it on TFS1.2 and it is only if you dont know want to think about wich outfit you should put on monster... for ex: you have made a monster called: "Player Killer" or "PK", or "Assassin", and each time you summon another monster this one will change only in one time his outfit to a random outfit. Script for Fun.
 
Last edited:
Back
Top