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

Train without monsters...

f@bio

Fudera Otserver
Joined
Jul 10, 2007
Messages
213
Reaction score
0
Location
Brasil
Hello friends, i'm copy and modifi this scripts, but this don't work fine for me....

-- I want this know a weapon on hand and train especied skill id... if don't have weapon don't train, don't have shield don't train and when you use other weapon train other skill... see my scripts and help me to fix to work fine plx... many thx for all

PHP:
-- Square Skill Trainer made by Arthur aka artofwork

-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 5 -- Number of tries per skill
local t = 3 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------

function trainerthree(p)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
	 if p.item.actionid == 9990 then
	    doPlayerSendTextMessage(p.cid,22,"Seu treinamento começará em 30 segundos.")
	    addEvent(trainertwo, 10 * 1000, p)
	 end
	 end
	    return FALSE
	 end

function trainertwo(p)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
	 if p.item.actionid == 9990 then
	    doPlayerSendTextMessage(p.cid,22,"Seu treinamento começará em 20 segundos.")
	    addEvent(trainerone, 10 * 1000, p)
	 end
	 end
	    return FALSE
	 end
	 
function trainerone(p)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
	 if p.item.actionid == 9990 then
	    doPlayerSendTextMessage(p.cid,22,"Seu treinamento começará em 10 segundos.")
  	    addEvent(readyToTrain, 10 * 1000, p)
	 end
	 end
	    return FALSE
	 end

function readyToTrain(p)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
	 if p.item.actionid == 9990 then
	    doPlayerSendTextMessage(p.cid,22,"Seu treinamento começará agora!!!")
	    addEvent(trainMeA, t, p)
	 end
	 end
	    return FALSE
	 end

function trainMeA(p)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 and p.item.actionid == 9990 then
	    doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)          
	    doSendAnimatedText(getPlayerPosition(p.cid), "Skilled...", TEXTCOLOR_ORANGE)
	    doSendMagicEffect(getPlayerPosition(p.cid),34)
         for a = 1, t do
         if(a == t) then	    
	 if isPaladin(p.cid) the
	 if getItemWeaponType(DIST) then
	 local mana = 20
	 if(getPlayerMana(p.cid) > mana) then
  	    doPlayerAddSpentMana(p.cid, skilltries)
    	    doPlayerAddMana(p.cid, -mana)
    	    doSendMagicEffect(getPlayerPosition(p.cid),33)
	 end
	 rand = math.random(1,3)
         if rand == 1 then             	 
	    doCreatureAddHealth(p.cid, -1)
  	 else
	    doCreatureAddHealth(p.cid, 0)
	 end      
	 if isPaladin(p.cid) and getPlayerWeapon(p.cid, 5) then
	    doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
  	 elseif isKnight(p.cid) and getPlayerWeapon(p.cid, sword) then
	    doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
  	 elseif isKnight(p.cid) and getPlayerWeapon(p.cid, axe) then
	    doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
  	 elseif isKnight(p.cid) and getPlayerWeapon(p.cid, club) then
	    doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
         end
	 end
	 end
	    addEvent(trainMeA, t, p)
	    doSendMagicEffect(getPlayerPosition(p.cid),32)
	 end
	    return FALSE
	 end

function onStepIn(cid, item)
local p = {cid = cid, item = item, pos = pos}
            setPlayerStorageValue(p.cid, 18010, 1)
	 if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
	 if p.item.actionid == 9990 then
	    addEvent(trainerthree, 1 * 1000, p)
	 end
	 end
	    return FALSE
	 end
         
function onStepOut(cid, item)
	    getPlayerStorageValue(cid, 18010)
	    setPlayerStorageValue(cid, 18010, 0)
	    doPlayerSendTextMessage(cid,22,"Seu treinamento foi encerrado!")
	 end

-- Many thx for all to help me...
 
Back
Top