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

Close Theard, Remove Theard!

Status
Not open for further replies.

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Close Theard, Remove Theard!
 
Last edited:
test
LUA:
local setup = {vocation = 4, level1 = 20, level2 = 40, item1 = 2400, item2 = 2390}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) ~= setup.vocation then
        doPlayerSendCancel(cid, 'You need to be a knight in order to use this item.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) >= 2 then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    local level = getPlayerPromotionLevel(cid) == 0 and setup.level1 or setup.level2
    
    if getPlayerLevel(cid) < level then
        doPlayerSendCancel(cid, 'You need to be at least level '..level..' to be promoted.')
        return true
    end
    
    if getPlayerPromotionLevel(cid) == 0 then
        doPlayerAddItem(cid, setup.item1, 1, true)
    elseif getPlayerPromotionLevel(cid) == 1 and getPlayerItemCount(cid, setup.item1) == 1 then
        doTransformItem(getPlayerItemById(cid, true, setup.item1).uid, setup.item2)
    else
        doPlayerSendCancel(cid, 'You need only 1 Magic Sword to be promoted.')
        return true
    end
    
    doRemoveItem(item.uid, 1)
    doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) == 0 and 1 or 2)
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
 
When you click and become a elite knight, you get a magic sword? and when you click again you become a ultimate knight and remove the magic sword from the character and get a magic long sword?
 
ok i will post them tomorrow i will test it becuase i not home :P but thx anyway
 
no errors, but you forgott something, knight's begin with fire sword when they click on the promotion scroll they become to elite knight and the scroll will be removed! the fire sword will be removed and a magic sword will come instead. then if you want to become to a ultimate knight when you click your magic sword will be removed and the scroll, then instead for the magic sword its will come a magic long sword.

Can you fix the sorcerer and knight on this scroll, the sorcerer will get instead sword wands! from sorcerer, master sorcerer and ultimate sorcerer.
 
Last edited:
its no error but i want it like this: knight's begin with fire sword when they click on the promotion scroll they become to elite knight and the scroll will be removed! the fire sword will be removed and a magic sword will come instead. then if you want to become to a ultimate knight when you click your magic sword will be removed and the scroll, then instead for the magic sword its will come a magic long sword.

Can you fix the sorcerer and knight on this scroll, the sorcerer will get instead sword wands! from sorcerer, master sorcerer and ultimate sorcerer.
player must click on scroll, not on sword/wand
2-in-1 script:
LUA:
local setup = {
	[1] = { --sorc
		level1 = 20,   --req level for 1st promo 
		level2 = 40,   --req level for 2nd promo 
		weapon1 = 2392, --1st req wep(no promo)
		weapon2 = 2400, --2nd req wep(1st promo)
		weapon3 = 2390  --3rd wep(2nd promo)
	},
	[4] = { --knight
		level1 = 20,
		level2 = 40,
		weapon1 = 2392, --firesword 
		weapon2 = 2400, --magicsword
		weapon3 = 2390  --magiclongsword
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local scroll = setup[getPlayerVocation(cid)]
    
	if not scroll then
        doPlayerSendCancel(cid, 'You need to be either a sorcerer or a knight in order to use this item.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) >= 2 then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    local level = getPlayerPromotionLevel(cid) == 0 and scroll.level1 or scroll.level2
 
    if getPlayerLevel(cid) < level then
        doPlayerSendCancel(cid, 'You need to be at least level '..level..' to be promoted.')
        return true
    end
 
    local weapon = getPlayerPromotionLevel(cid) == 0 and scroll.weapon1 or scroll.weapon2
	
	if getPlayerItemCount(cid, weapon) == 1 then
		doTransformItem(getPlayerItemById(cid, true, weapon).uid, getPlayerPromotionLevel(cid) == 0 and scroll.weapon2 or scroll.weapon3)
	else
        doPlayerSendCancel(cid, 'You need only 1 '.. getItemNameById(weapon)..' to be promoted.')
        return true
    end
 
    doRemoveItem(item.uid, 1)
    doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) == 0 and 1 or 2)
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
remember to edit sorc wands itemid:
Code:
	[1] = { --sorc
		level1 = 20,   --req level for 1st promo 
		level2 = 40,   --req level for 2nd promo 
[COLOR="red"]		weapon1 = 2392, --1st req wep(no promo)
		weapon2 = 2400, --2nd req wep(1st promo)
		weapon3 = 2390  --3rd wep(2nd promo)
[/COLOR]	},
 
Last edited:
how can i change example: voc: 4 knight then voc 8 elite knight
 
but i have own vocations on tfs 0.3.6 example voc id: 1 its a ninja and when i want it become a ultimate ninja the voc id is: 2
 
ok:

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="None" description="none" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="0">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="1" name="Ninja" description="a Ninja" gaincap="1000" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="580" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="2" name="Super Ninja" description="a Super Ninja" gaincap="1000" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="580" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="3" name="Super Star Ninja" description="a Super Star Ninja" gaincap="1000" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="580" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="4" name="Warrior" description="a Warrior" gaincap="1000" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="580" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="5" name="Mega Warrior" description="a Mega Warrior" gaincap="1110" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="1" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="6" name="Ultra Warrior" description="a Ultra Warrior" gaincap="1110" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="1" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="7" name="Mage" description="a Mage" gaincap="1110" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="1" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="8" name="Mega Mage" description="a Mega Mage" gaincap="1110" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="1" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="9" name="Ultra Mage" description="a Ultra Mage" gaincap="1110" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="1" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>
</vocations>
 
tfs 0.3.6

what should i do?

refresh pls pls cyberm help me with the vocation and i forgotted something: when you click you become a elite knight the fire sword will be removed and a magic sword will come the if you click again on the scroll you become ultimate knight the magic sword will be removed and you get a magic long sword instead! and when you become elite knight i want to edit the outfits and on the ultimate knight too!

refresh

Cyko if you doesnt understand what i want pls post a comment i will explain.
 
Last edited by a moderator:
You seem to have ignored my last script
outfits:
LUA:
local setup = {
    [1] = { --sorc
        level1 = 20,   --req level for 1st promo 
        level2 = 40,   --req level for 2nd promo
        outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        weapon1 = 2392, --1st req wep(no promo)
        weapon2 = 2400, --2nd req wep(1st promo)
        weapon3 = 2390 --3rd wep(2nd promo)
    },
    [4] = { --knight
        level1 = 20,
        level2 = 40,
        outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        weapon1 = 2392, --firesword 
        weapon2 = 2400, --magicsword
        weapon3 = 2390 --magiclongsword
    }
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local scroll = setup[getPlayerVocation(cid)]
 
    if not scroll then
        doPlayerSendCancel(cid, 'You need to be either a sorcerer or a knight in order to use this item.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) >= 2 then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    local level = getPlayerPromotionLevel(cid) == 0 and scroll.level1 or scroll.level2
 
    if getPlayerLevel(cid) < level then
        doPlayerSendCancel(cid, 'You need to be at least level '..level..' to be promoted.')
        return true
    end
 
    local weapon = getPlayerPromotionLevel(cid) == 0 and scroll.weapon1 or scroll.weapon2
 
    if getPlayerItemCount(cid, weapon) == 1 then
        doTransformItem(getPlayerItemById(cid, true, weapon).uid, getPlayerPromotionLevel(cid) == 0 and scroll.weapon2 or scroll.weapon3)
    else
        doPlayerSendCancel(cid, 'You need only 1 '.. getItemNameById(weapon)..' to be promoted.')
        return true
    end
 
    local outfit = getPlayerPromotionLevel(cid) == 0 and scroll.outfit1 or scroll.outfit2
    
    if outfit then
        doCreatureChangeOutfit(cid, outfit)
    end
    
    doRemoveItem(item.uid, 1)
    doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) == 0 and 1 or 2)
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
 
cymberm this script is PERFECT!!! but one problem the vocation how can i fix that?
 
[4] = { --knight
level1 = 20,
level2 = 40,
outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
weapon1 = 2392, --firesword
weapon2 = 2400, --magicsword
weapon3 = 2390 --magiclongsword

How do i know after knight he would be elite knight and after elite he will be ultra knight?

Level1 = 20 = Elite Knight voc (8)
Level2 = 40 = Ultra Knight voc (12)
 
the script does that autom.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local scroll = setup[getPlayerVocation(cid)]
 
    if not scroll then
        doPlayerSendCancel(cid, 'You need to be either a sorcerer or a knight in order to use this item.')
        return true
    end
 
    if [COLOR=red]getPlayerPromotionLevel(cid) >= 2[/COLOR] then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    local level = [COLOR=red]getPlayerPromotionLevel(cid) == 0[/COLOR] and scroll.level1 or scroll.level2
 
    if getPlayerLevel(cid) < level then
        doPlayerSendCancel(cid, 'You need to be at least level '..level..' to be promoted.')
        return true
    end
 
    local weapon = [COLOR=red]getPlayerPromotionLevel(cid) == 0 [/COLOR]and scroll.weapon1 or scroll.weapon2
 
    if getPlayerItemCount(cid, weapon) == 1 then
        doTransformItem(getPlayerItemById(cid, true, weapon).uid, [COLOR=red]getPlayerPromotionLevel(cid) == 0[/COLOR] and scroll.weapon2 or scroll.weapon3)
    else
        doPlayerSendCancel(cid, 'You need only 1 '.. getItemNameById(weapon)..' to be promoted.')
        return true
    end
 
    local outfit = [COLOR=red]getPlayerPromotionLevel(cid) == 0[/COLOR] and scroll.outfit1 or scroll.outfit2
 
    if outfit then
        doCreatureChangeOutfit(cid, outfit)
    end
 
    doRemoveItem(item.uid, 1)
    [COLOR=red]doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) == 0 and 1 or 2)[/COLOR]
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
promotion level 0 = non promoted(knight)
promotion level 1 = elite knight
promotion level 2 = epic/ultimate knight

the same for any vocation
 
Status
Not open for further replies.
Back
Top