• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Dat-Editor-Problem.

Katrina

New Member
Joined
Nov 20, 2010
Messages
28
Reaction score
3
Hello everyone,


Today i tried to add my monsters in the tibia.dat and tibia.spr
worked fine.
But idk what to do now..
I tested already with that:
I puted in the tibia.spr,tibia.dat in the folder from my Custom Client.
I have try to make /newtype 352 ,it doesnt works.

Thanks for help ! Rep++



Katrina <3*
 
You really dont need to bump every hour.

Bumping everyday is OK.

If people knew the answer they would post it, but if they dont know your answer, they dont post any answer becaouse its such spam to post "I dont know".
 
I think it's script limitation that prevents debugs when you try to change your outfit to non-existing one, try editing ./data/talkactions/scripts/newtype.lua
 
Solution nr 1:

This will let you say ./newtpye dragon instead of doing it with numbers also.
data/lib/099-outfits.lua
LUA:
local setup = {
    XML = '';
    null = {0,1,135},
    range = {161,191},
    other = {302,266,75,255,254,253,160,159,12},
    idMin = 1,
    idMax = 35
}
 
local error = {
    [0] = '[OUTFIT_LIB] PLAYER NOT FOUND',
    [1] = '[OUTFIT_LIB] INVALID ID',
    [2] = '[OUTFIT_LIB] INVALID LOOKTYPE',
    [3] = '[OUTFIT_LIB] CREATURE NOT FOUND',
    [4] = '[OUTFIT_LIB] ID DOES NOT MATCH',
    [5] = '[OUTFIT_LIB] NAME DOES NOT MATCH'
}
 
local list =  {  
    [2]='Orc Warlord',[3]='War Wolf',[4]='Orc Rider',[5]='Orc',[6]='Orc Shaman',
    [7]='Orc Warrior',[8]='Orc Berserker',[9]='Necromancer',[10]='Yellow Butterfly',
    [11]='Water Elemental',[13]='Black Sheep',[14]='Sheep',[15]='Troll',
    [16]='Bear',[17]='Beholder',[18]='Ghoul',[19]='Slime',[20] ='Quara Predator',[21]='Rat',
    [22]='Cyclops',[23]='Minotaur Mage',[24]='Minotaur Archer',[25]='Minotaur',[26]='Rotworm',
    [27]='Wolf',[28]='Snake',[29]='Minotaur Guard',[30]='Spider',[31]='Deer',[32]='Dog',
    [33]='Skeleton',[34]='Dragon',[35]='Demon',[36]='Poison Spider',[37]='Demon Skeleton',
    [38]='Giant Spider',[39]='Dragon Lord',[40]='Fire Devil',[41]='Lion',[42]='Polar Bear',
    [43]='Scorpion',[44]='Wasp',[45]='Bug',[46]='Quara Constrictor',[47]='Quara Hydromancer',
    [48]='Ghost',[49]='Fire Elemental',[50]='Orc Spearman',[51]='Green Djinn',[52]='Winter Wolf',
    [53]='Frost Troll',[54]='Witch',[55]='Behemoth',[56]='Cave Rat',[57]='Monk',[58]='Priestess',
    [59]='Orc Leader',[60]='Pig',[61]='Goblin',[62]='Elf',[63]='Elf Arcanist',[64]='Elf Scout',
    [65]='Mummy',[66]='Dwarf Geomancer',[67]='Stone Golem',[68]='Vampire',[69]='Dwarf',
    [70]='Dwarf Guard',[71]='Dwarf Soldier',[72]='Quara Mantassin',[73]='Hero',[74]='Rabbit',
    [76]='Swamp Troll',[77]='Quara Pincher',[78]='Banshee',[79]='Ancient Scarab',
    [80]='Blue Djinn',[81]='Cobra',[82]='Larva',[83]='Scarab',[84]='Ormuc',[85]='Morguthis',
    [86]='Thalas',[87]='Dipthrah',[88]='Arkhothep',[89]='Mahrdis',[90]='Vashresamun',
    [91]='Ashmunrah',[92]='Mimic',[93]='Pirate Marauder',[94]='Hyaena',[95]='Gargoyle',
    [96]='Pirate Cutthroat',[97]='Pirate Buccaneer',[98]='Pirate Corsair',[99]='Lich',
    [100]='Crypt Shambler',[101]='Bone Beast',[102]='Deathslicer',[103]='Efreet',[104]='Marid',
    [105]='Badger',[106]='Skunk',[107]='Demon',[108]='Elder Beholder',[109]='Gazer',[110]='Yeti',
    [111]='Chicken',[112]='Crab',[113]='Lizard Templar',[114]='Lizard Sentinel',
    [115]='Lizard Snakecharmer',[116]='Kongra',[117]='Merlkin',[118]='Sibang',[119]='Crocodile',
    [120]='Carniphila',[121]='Hydra',[122]='Bat',[123]='Panda',[124]='Centipede',[125]='Tiger',
    [126]='Old Woman',[127]='Old Man',[192]='Carrion Worm',[193]='Enlightened Of The Cult',
    [194]='Adept Of The Cult',[195]='Pirate Skeleton',[196]='Pirate Ghost',[197]='Tortoise',
    [198]='Thornback Tortoise',[199]='Mammoth',[200]='Blood Crab',[201]='Demon',
    [202]='Minotaur Guard',[203]='Elf Arcanist',[204]='Dragon Lord',[205]='Stone Golem',
    [206]='Monk',[207]='Minotaur Guard',[208]='Giant Spider',[209]='Necromancer',
    [210]='Elder Beholder',[211]='Elephant',[212]='Flamingo',[213]='Purple Butterfly',
    [214]='Dworc Voodoomaster',[215]='Dworc Fleshhunter',[216]='Dworc Venomsniper',
    [217]='Parrot',[218]='Terror Bird',[219]='Tarantula',[220]='Serpent Spawn',
    [221]='Spit Nettle',[222]='Toad',[223]='Seagull',[224]='Green Frog',[225]='Monk',
    [226]='Frog',[227]='Blue Butterfly',[228]='Red Butterfly',[229]='Ferumbras',
    [230]='Hand Of Cursed Fate',[231]='Undead Dragon',[232]='Lost Soul',[233]='Betrayed Wraith',
    [234]='Dark Torturer',[235]='Spectre',[236]='Destroyer',[237]='Diabolic Imp',
    [238]='Defiler',[239]='Wyvern',[240]='Hellhound',[241]='Phantasm',
    [242]='Blistering Fire Elemental',[243]='Hellfire Fighter',[244]='Juggernaut',
    [245]='Nightmare',[246]='Blightwalker',[247]='Plaguesmith',[248]='Frost Dragon',
    [249]='Chakoya Tribewarden',[250]='Penguin',[256]='Braindeath',[257]='Frost Giant',
    [258]='Husky',[259]='Chakoya Toolshaper',[260]='Chakoya Windcaller',[261]='Ice Golem',
    [262]='Silver Rabbit',[263]='Crystal Spider',[264]='Barbarian Brutetamer',
    [265]='Frost Giantess',[267]='Swimsuit',[271]='Dragon Hatchling',
    [272]='Dragon Lord Hatchling',[274]='Squirrel',[275]='Sea Serpent',[276]='Cat',
    [277]='Cyclops Smith',[280]='Cyclops Drone',[281]='Troll Champion',
    [282]='Island Troll',[283]='Frost Dragon Hatchling',[284]='Cockroach',
    [285]='Massive Earth Elemental',[286]='Water Elemental',[287]='Vampire Overlord',
    [290]='Massive Energy Elemental',[291]='Wyrm',[292]='Mutated Pumpkin',
    [293]='Energy Elemental',[294]='Wisp',[295]='Rotworm Queen',[296]='Goblin Assassin',
    [297]='Goblin Scavenger',[298]='Skeleton Warrior',[299]='Bog Raider',[300]='Grim Reaper',
    [301]='Earth Elemental',[303]='Undead Tortoise',[304]='Worker Golem',[305]='Mutated Rat',
    [306]='Undead Gladiator',[307]='Mutated Bat',[308]='Werewolf',[309]='Yalahari',
    [310]='Haunted Treeling',[311]='Zombie',[312]='Vampire Bride',[313]='Gozzler',
    [314]='Acid Blob',[315]='Death Blob',[316]='Mercury Blob',[317]='Young Sea Serpent',
    [318]='Mutated Tiger',[319]='Haunted Spirit',[320]='Nightstalker',[321]='Nightmare Scion',
    [322]='Hellspawn',[323]='Mutated Human',[326]='War Golem',[327]='Wedding',[330]='Medusa',
    [331]='Queen Eloise',[332]='King Tibianus',[333]='Medusa Stone',[334]='Draken Warmaster',
    [337]='Lizard High Guard',[338]='Lizard Legionnaire',[339]='Lizard Dragon Priest',
    [340]='Draken Spellweaver',[341]='Gnarlhound',[342]='Orc Marauder',[343]='Lizard Zaogun',
    [344]='Lizard Chosen',[345]='Eternal Guardian',[346]='Terramite',[347]='Wailing Widow',
    [348]='Lancer Beetle',[349]='Insect Swarm',[350]='Sandcrawler',[351]='Ghastly Dragon',
    [COLOR="red"][352]='YOUR MONSTER',[/COLOR]
}    
 
function string.fix(s)
    return s:gsub("(%a)([%w_']*)", function(first, rest) return first:upper()..rest:lower() end)
end
 
function isBetweenRange(value, from, to)
    return from <= value and value <= to
end
 
function isOutfit(lookType)
    return tonumber(lookType) and not tostring(lookType) and not isInArray(setup.null,lookType) and not isBetweenRange(lookType, setup.range[1], setup.range[2]) and isInArray(setup.other,lookType) or isInArray(maleOutfits,lookType) or isInArray(femaleOutfits,lookType) or list[lookType]
end
 
function getOutfitNameByID(id)
    return tonumber(id) == nil and error[1] or isBetweenRange(tonumber(id), setup.idMin, setup.idMax) and (setup.XML:match('<outfit%s*id="'..tonumber(id)..'".->(.-)</outfit>') or ''):match('name="(.-)"') or error[1]
end
 
function getCreatureOutfitName(cid)
    return not isCreature(cid) and error[3] or list[getCreatureOutfit(cid).lookType] and list[getCreatureOutfit(cid).lookType] or setup.XML:match('lookType="'..getCreatureOutfit(cid).lookType..'"%s*name="(.-)"/>')
end
 
function getPlayerOutfitID(cid)
    if not isPlayer(cid) then
        return error[0]
    end
    local t = ''
    for id, v in setup.XML:gmatch('<outfit.-id="(%d+)".->(.-)</outfit>') do
        if v:match('lookType="'..getCreatureOutfit(cid).lookType..'"') then
            t = id
            break
        end
    end
    return tonumber(t) or error[4]
end
 
function getOutfitIDByName(name)
    t, name = '', string.fix(name)
    if not tostring(name) or tonumber(name) then
        return error[5]
    end
    for id, v in setup.XML:gmatch('<outfit.-id="(%d+)".->(.-)</outfit>') do
        if v:match('name="'..name..'"') then
            t = tonumber(id)
            break
        end
    end
    return not tonumber(t) and error[5] or t
end
 
function getOutfitNameByLookType(lookType)
    t, lookType = '', tonumber(lookType)
    if lookType == nil or not isOutfit(lookType) then return error[5] end
    for i, j in pairs(list) do
        if lookType == i then
            t = j
            break
        else
            t = setup.XML:match('lookType="'..lookType..'"%s*name="(.-)"/>')
        end
    end
    return not tostring(t) and error[2] or t
end
 
function getOutfitLookTypeByName(name)
    t, name = '', string.fix(name)
    if not tostring(name) or tonumber(name) then
        return error[5]
    end
    for i, j in pairs(list) do
        if name == j then
            t = i
            break
        else
            t = setup.XML:match('lookType="(%d+)"%s*name="'..name..'"/>')
        end
    end
    return not tonumber(t) and error[5] or t
end
 
do
    local o = io.open('data/XML/outfits.xml','r')
	setup.XML = o:read('*a')
	o:close()
end

Then replace your newtype at data/talkactions/scripts for this:
LUA:
function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Command requires param.')
        return true
    end
 
    local t = string.explode(param, ',')
 
    if tonumber(t[1]) then
        t[1] = tonumber(t[1])
    elseif tostring(t[1]) then
        t[1] = getOutfitLookTypeByName(t[1])
    end    
 
    if not t[1] then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Command requires valid param.')
        return true
    end
 
    local pid = cid
    if(t[2]) then
        pid = getPlayerByNameWildcard(t[2])
        if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. t[2] .. ' not found.')
            return true
        end
    end
 
    if not isOutfit(t[1]) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Such outfit does not exist.')
        return true
    end
 
    doSendMagicEffect(getThingPos(pid),2)
    addEvent(doCreatureChangeOutfit, 10, pid, {lookType = t[1]})
    return true
end

Solution nr 2, try to edit this probably? not sure:
data/talkactions/scripts/newtype.lua
line 23:

if(t[1] <= 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 351) then
 
@santigggg

I didnt got 099-outfits.lua in my lib folder.
Should i create one ?

- At newtype,i already have newtype,should i add that what u send me ?
 
@santigggg

thanks alot !!

if(t[1] <= 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 351) then
that works !! i just made it to 352 ^^ thanks thanks rep++
 

Similar threads

Back
Top