• 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!

Solved Tfs 1.0 Addon quest by click?

povedijah

Member
Joined
Jan 11, 2010
Messages
93
Reaction score
6
Hello everyone, can someone do this scripts for tfs 1.0, it tell me i have the addon, but it doesn't give anything
Code:
local t = {
[12001] = 'Citizen',128,136;
[12002] = 'Hunter',137,129;
[12003] = 'Mage',138,130;
[12004] = 'Knight',139,131;
[12005] = 'Nobleman',140,132;
[12006] = 'Summoner',141,133;
[12007] = 'Warrior',142,134;
[12008] = 'Barbarian',147,143;
[12009] = 'Druid',148,144;
[12010] = 'Wizard',149,145;
[12011] = 'Oriental',150,146;
[12012] = 'Pirate',155,152;
[12013] = 'Assassin',156,152;
[12014] = 'Beggar',157,153;
[12015] = 'Shaman',158,154;
[12016] = 'Norse',252,251;
[12017] = 'Nightmare',269,268;
[12018] = 'Jester',270,273;
[12019] = 'Brotherhood',279,278;
[12020] = 'Demonhunter',288,289;
[12021] = 'Yalaharian',324,325;
[12022] = 'Warmaster',336,335;
[12023] = 'Afflicted',336,367;
[12024] = 'Elementalist',336,432;
[12025] = 'Deepling',336,463;
[12026] = 'Insectoid',336,465;
[12027] = 'Entrepreneur',336,472;
[12028] = 'Crystal Warlord',336,512;
[12029] = 'Soil Guardian',336,516;
[12030] = 'Demon',336,541;
[12031] = 'Cave Explorer',336,574;
[12032] = 'Dream Warden',336,577;
[12033] = 'Glooth Engineer',336,610;
[12034] = 'Champion',336,633;
[12035] = 'Beastmaste',336,634;
[12036] = 'Conjurer',635,637;
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.uid]
if v then
if getPlayerStorageValue(cid,v[1]) == -1 then
doPlayerSendTextMessage(cid,21,"You now have the " .. t[item.uid] .. " Outfit!")
doPlayerAddOutfit(cid,v[2] ,3)
setPlayerStorageValue(cid,v[1],1)
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
else
doCreatureSay(cid, 'You already have the ' .. t[item.uid] .. ' Addons!', TALKTYPE_ORANGE_1, false, cid)
end
end
return true
end
 
Last edited:
Code:
local t = {
   [12001] = {22001, 'Citizen', 136, 128},
   [12002] = {22002, 'Hunter', 137, 129},
   [12003] = {22003, 'Mage', 138, 130},
   [12004] = {22004, 'Knight', 139, 131},
   [12005] = {22005, 'Nobleman', 140, 132},
   [12006] = {22006, 'Summoner', 141, 133},
   [12007] = {22007, 'Warrior', 142, 134},
   [12008] = {22008, 'Barbarian', 147, 143},
   [12009] = {22009, 'Druid', 148, 144},
   [12010] = {22010, 'Wizard', 149, 145},
   [12011] = {22011, 'Oriental', 150, 146},
   [12012] = {22012, 'Pirate', 155, 151},
   [12013] = {22013, 'Assassin', 156, 152},
   [12014] = {22014, 'Beggar', 157, 153},
   [12015] = {22015, 'Shaman', 158, 154},
   [12016] = {22016, 'Norse' , 252, 251},
   [12017] = {22017, 'Nightmare', 269, 268},
   [12018] = {22018, 'Jester', 270, 273},
   [12019] = {22019, 'Brotherhood', 279, 278},
   [12020] = {22020, 'Demonhunter', 288, 289},
   [12021] = {22021, 'Yalaharian', 324, 325},
   [12022] = {22022, 'Warmaster', 336, 335}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
     local player = Player(cid)
     local v = t[item.uid]
     if v then
         if player:getStorageValue(v[1]) == -1 then
             if player:getSex() == 0 then
                 player:addOutfitAddon(v[3], 3)
             else
                 player:addOutfitAddon(v[4], 3)
             end
             player:sendTextMessage(MESSAGE_INFO_DESCR, "You now have the " .. v[2] .. " outfit!")
             player:setStorageValue(v[1], 1)
             player:getPosition():sendMagicEffect(math.random(1, 67))
         else
             player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have the " .. v[2] .. " outfit.")
         end
     end
     return true
end
 
Hey limos, if is not a problem for you how can i change this script for mount quests?, can you explain me what does that part "(v[3]<<what does it means?, 3(this is for 3 first and second addon?)"?
 
v is a table (specifically t[item.uid], where item.uid is used as a key to index the table t).
Look at the table t above (in Limos' code). An example of v would be this: {22008, 'Barbarian', 147, 143}

As I already said, v is a table, specifically an array. So, values in v are ordered by numbered indices.
In the example above I showed, 22008 is index 1, 'Barbarian' is index 2, 147 is index 3, 143 is index 4.

So, when we do v[3], we're looking at the third index of the table.
If we're using the above example, then v[3] is 147; which I assume is the female outfit id for Barbarian.

And yes, the 2nd 3 in the function is for both addons.
 
Thank you evan, with your explain i converted the script for mounts, :D
Code:
local t = {
   [12040] = {22040, 'Widow Queen', 1},
} 


function onUse(cid, item, fromPosition, itemEx, toPosition)
     local player = Player(cid)
     local v = t[item.uid]
     if v then
         if player:getStorageValue(v[1]) == -1 then
             if player:getSex() == 0 then
                 player:addMount(v[3])
             else
                 player:addMount(v[3])
             end
             player:sendTextMessage(MESSAGE_INFO_DESCR, "You now have the " .. v[2] .. " mount!")
             player:setStorageValue(v[1], 1)
             player:getPosition():sendMagicEffect(math.random(1, 67))
         else
             player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have the " .. v[2] .. " mount!.")
         end
     end
     return true
end
 
You can remove the gender check, so just this
Code:
player:addMount(v[3])
Instead of this
Code:
if player:getSex() == 0 then
     player:addMount(v[3])
else
     player:addMount(v[3])
end
 
Used Limos code, double checked values provided by povedijah, made it so that you get both male and female addons
(which is a must have if you let players change their gender cause once you get them you can't get them again for the other sex), added female cave explorer and dream warden, partially added 10.50 outfits as comments since there is no official 10.50 TFS yet. :)

actions\scripts\addons.lua
Code:
local t = {
   [12001] = {22001, 'Afflicted', 430, 431},
   [12002] = {22002, 'Assassin', 152, 156},
   [12003] = {22003, 'Barbarian', 143, 147},
   [12004] = {22004, 'Beggar', 153, 157},
   [12005] = {22005, 'Brotherhood', 278, 279},
   [12006] = {22006, 'Citizen', 128, 136},
   [12007] = {22007, 'Crystal Warlord', 512, 513},
   [12008] = {22008, 'Deepling', 463, 464},
   [12009] = {22009, 'Demon', 542, 541},
   [12010] = {22010, 'Demonhunter', 289, 288},
   [12011] = {22011, 'Druid', 144, 148},
   [12012] = {22012, 'Elementalist', 432, 433},
   [12013] = {22013, 'Entrepreneur', 472, 471},
   [12014] = {22014, 'Hunter', 137, 129},
   [12015] = {22015, 'Insectoid', 465, 466},
   [12016] = {22016, 'Jester', 273, 270},
   [12017] = {22017, 'Knight', 131, 139},
   [12018] = {22018, 'Mage', 130, 138},
   [12019] = {22019, 'Nightmare', 268, 269},
   [12020] = {22020, 'Noble', 132, 140},
   [12021] = {22021, 'Norse', 251, 252},
   [12022] = {22022, 'Oriental', 146, 150},
   [12023] = {22023, 'Pirate', 151, 155},
   [12024] = {22024, 'Shaman', 154, 158},
   [12025] = {22025, 'Knight', 131, 139},
   [12026] = {22026, 'Soil Guardian', 514, 516},
   [12027] = {22027, 'Summoner', 133, 141},
   [12028] = {22028, 'Warmaster', 335, 336},
   [12029] = {22029, 'Warrior', 134, 142},
   [12030] = {22030, 'Wayfarer', 367, 366},
   [12031] = {22031, 'Wizard', 145, 149},
   [12032] = {22032, 'Yalaharian', 325, 324},
   [12033] = {22033, 'Cave Explorer', 574, 575},
   [12034] = {22034, 'Dream Warden', 577, 578},

--   [12035] = {22035, 'Glooth Engineer', ???, 610},
--   [12036] = {22036, 'Champion', ???, 633},
--   [12037] = {22037, 'Beastmaster', ???, 634},
--   [12038] = {22038, 'Conjurer', 635, 637},
--   336 is female warmaster afaik and since i don't have unofficial 10.53 TFS i don't know used values
}



function onUse(cid, item, fromPosition, itemEx, toPosition)
     local player = Player(cid)
     local v = t[item.uid]
     if v then
         if player:getStorageValue(v[1]) == -1 then
             if player:getSex() == 0 then
                 player:addOutfitAddon(v[3], 3)
                player:addOutfitAddon(v[4], 3)
             else
                player:addOutfitAddon(v[3], 3)
                 player:addOutfitAddon(v[4], 3)
             end
             player:sendTextMessage(MESSAGE_INFO_DESCR, "You now have the " .. v[2] .. " outfit!")
             player:setStorageValue(v[1], 1)
             player:getPosition():sendMagicEffect(math.random(1, 67))
         else
             player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have the " .. v[2] .. " outfit.")
         end
     end
     return true
end

actions\actions.xml
Code:
    <!-- Addons -->
    <action uniqueid="12001" script="addons.lua"/>    <!-- Afflicted -->
    <action uniqueid="12002" script="addons.lua"/>    <!-- Assassin -->
    <action uniqueid="12003" script="addons.lua"/>    <!-- Barbarian -->
    <action uniqueid="12004" script="addons.lua"/>    <!-- Beggar -->
    <action uniqueid="12005" script="addons.lua"/>    <!-- Brotherhood -->
    <action uniqueid="12006" script="addons.lua"/>    <!-- Citizen -->
    <action uniqueid="12007" script="addons.lua"/>    <!-- Crystal Warlord -->
    <action uniqueid="12008" script="addons.lua"/>    <!-- Deepling -->
    <action uniqueid="12009" script="addons.lua"/>    <!-- Demon -->
    <action uniqueid="12010" script="addons.lua"/>    <!-- Demonhunter -->
    <action uniqueid="12011" script="addons.lua"/>    <!-- Druid -->
    <action uniqueid="12012" script="addons.lua"/>    <!-- Elementalist -->
    <action uniqueid="12013" script="addons.lua"/>    <!-- Entrepreneur -->
    <action uniqueid="12014" script="addons.lua"/>    <!-- Hunter -->
    <action uniqueid="12015" script="addons.lua"/>    <!-- Insectoid -->
    <action uniqueid="12016" script="addons.lua"/>    <!-- Jester -->
    <action uniqueid="12017" script="addons.lua"/>    <!-- Knight -->
    <action uniqueid="12018" script="addons.lua"/>    <!-- Mage -->
    <action uniqueid="12019" script="addons.lua"/>    <!-- Nightmare -->
    <action uniqueid="12020" script="addons.lua"/>    <!-- Noble -->
    <action uniqueid="12021" script="addons.lua"/>    <!-- Norse -->
    <action uniqueid="12022" script="addons.lua"/>    <!-- Oriental -->
    <action uniqueid="12023" script="addons.lua"/>    <!-- Pirate -->
    <action uniqueid="12024" script="addons.lua"/>    <!-- Shaman -->
    <action uniqueid="12025" script="addons.lua"/>    <!-- Knight -->
    <action uniqueid="12026" script="addons.lua"/>    <!-- Soil Guardian -->
    <action uniqueid="12027" script="addons.lua"/>    <!-- Summoner -->
    <action uniqueid="12028" script="addons.lua"/>    <!-- Warmaster -->
    <action uniqueid="12029" script="addons.lua"/>    <!-- Warrior -->
    <action uniqueid="12030" script="addons.lua"/>    <!-- Wayfarer -->
    <action uniqueid="12031" script="addons.lua"/>    <!-- Wizard -->
    <action uniqueid="12032" script="addons.lua"/>    <!-- Yalaharian -->
    <action uniqueid="12033" script="addons.lua"/>    <!-- Cave Explorer -->
    <action uniqueid="12034" script="addons.lua"/>    <!-- Dream Warden -->
    <!-->    <action uniqueid="12035" script="addons.lua"/>    <!-- Glooth Engineer -->
    <!-->    <action uniqueid="12036" script="addons.lua"/>    <!-- Champion -->
    <!-->    <action uniqueid="12037" script="addons.lua"/>    <!-- Beastmaster -->
    <!-->    <action uniqueid="12038" script="addons.lua"/>    <!-- Conjurer -->

Edit: Just noticed I necroed month old topic. Well, could be worse. :p
 
Last edited:
Back
Top