Ir para conteúdo
Entre para seguir isso  
Eratsu

Addon por level

Recommended Posts

Eratsu    37
Eratsu

Sistema de addon por level

Autor: Acordion

Testado: TFS 0.4

Retirado: OtLand.net

 

 

 

Explicação:

Assim que o player alcançar o level 30, ele ganha a citizen addons.

Level 50, hunter addons. E assim por diante.

 

Instalação:

Na pasta creaturescripts, abra o creaturescripts.xml e adicione:

<event type="advance" name="Addons" event="script" value="Addons.lua"/>

Vá na pasta scripts e abra o arquivo login.lua e adicione:

registerCreatureEvent(cid, "Addons")

Crie um arquivo Addons.lua dentro da pasta scripts e coloque isto:

function onAdvance(cid, skill, oldLevel, newLevel)


--- Other Config ---
local TextType = MESSAGE_STATUS_CONSOLE_ORANGE

--- Citizen ---
local citizentext = "You have now citizen addons."
local citizenlevel = 30
local citizenstorage = 11500
--- Hunter ---
local huntertext = "You have now hunter addons."
local hunterlevel = 50
local hunterstorage = 11505
--- Mage ---
local magetext = "You have now mage addons."
local magelevel = 60
local magestorage = 11510
--- Knight ---
local knighttext = "You have now knight addons."
local knightlevel = 70
local knightstorage = 11515
--- Noble ---
local nobletext = "You have now noble addons."
local noblelevel = 90
local noblestorage = 11520
--- Summoner ---
local summonertext = "You have now summoner addons."
local summonerlevel = 100
local summonerstorage = 11525
--- Warrior ---
local Warriortext = "You have now Warrior addons."
local Warriorlevel = 120
local Warriorstorage = 11530
--- Barbarian ---
local Barbariantext = "You have now Barbarian addons."
local Barbarianlevel = 125
local Barbarianstorage = 11605
--- Druid ---
local Druidtext = "You have now Druid addons."
local Druidlevel = 130
local Druidstorage = 11535
--- Wizard ---
local Wizardtext = "You have now Wizard addons."
local Wizardlevel = 135
local Wizardstorage = 11540
--- Oriental ---
local Orientaltext = "You have now Oriental addons."
local Orientallevel = 150
local Orientalstorage = 11545
--- Pirate ---
local Piratetext = "You have now Pirate addons."
local Piratelevel = 155
local Piratestorage = 11550
--- Assassin ---
local Assassintext = "You have now Assassin addons."
local Assassinlevel = 170
local Assassinstorage = 11555
--- Beggar ---
local Beggartext = "You have now Beggar addons."
local Beggarlevel = 175
local Beggarstorage = 11560
--- Shaman ---
local Shamantext = "You have now Shaman addons."
local Shamanlevel = 270
local Shamanstorage = 11565
--- Norse ---
local Norsetext = "You have now Norse addons."
local Norselevel = 180
local Norsestorage = 11570
--- Nightmare ---
local Nightmaretext = "You have now Nightmare addons."
local Nightmarelevel = 190
local Nightmarestorage = 11575
--- Jester ---
local Jestertext = "You have now Jester addons."
local Jesterlevel = 200
local Jesterstorage = 11580
--- Brotherhood ---
local Brotherhoodtext = "You have now Brotherhood addons."
local Brotherhoodlevel = 220
local Brotherhoodstorage = 11585
--- Demonhunter ---
local Demonhuntertext = "You have now Demonhunter addons."
local Demonhunterlevel = 240
local Demonhunterstorage = 11590
--- Yalaharian ---
local Yalahariantext = "You have now Yalaharian addons."
local Yalaharianlevel = 245
local Yalaharianstorage = 11595
--- Warmaster ---
local Warmastertext = "You have now Warmaster addons."
local Warmasterlevel = 260
local Warmasterstorage = 11600


--- Citizen ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= citizenlevel) then
           if(getPlayerStorageValue(cid, citizenstorage) == -1)then 
               doPlayerAddOutfit(cid, 136, 3)
               doPlayerAddOutfit(cid, 128, 3)
               setPlayerStorageValue(cid, citizenstorage, 1)
               doPlayerSendTextMessage(cid, TextType, citizentext)
               end
       end
   end
--- Hunter ---    
   if (skill == SKILL__LEVEL) then
       if(newLevel >= hunterlevel) then
           if(getPlayerStorageValue(cid, hunterstorage) == -1)then 
               doPlayerAddOutfit(cid, 137, 3)
               doPlayerAddOutfit(cid, 129, 3)
               setPlayerStorageValue(cid, hunterstorage, 1)
               doPlayerSendTextMessage(cid, TextType, huntertext)
               end
       end
   end
--- Mage ---    
   if (skill == SKILL__LEVEL) then
       if(newLevel >= magelevel) then
           if(getPlayerStorageValue(cid, magestorage) == -1)then 
               doPlayerAddOutfit(cid, 138, 3)
               doPlayerAddOutfit(cid, 130, 3)
               setPlayerStorageValue(cid, magestorage, 1)
               doPlayerSendTextMessage(cid, TextType, magetext)
               end
       end
   end
--- Knight ---    
   if (skill == SKILL__LEVEL) then
       if(newLevel >= knightlevel) then
           if(getPlayerStorageValue(cid, knightstorage) == -1)then 
               doPlayerAddOutfit(cid, 139, 3)
               doPlayerAddOutfit(cid, 131, 3)
               setPlayerStorageValue(cid, knightstorage, 1)
               doPlayerSendTextMessage(cid, TextType, knighttext)
               end
       end
   end
--- Nobleman and Noblewoman ---    
   if (skill == SKILL__LEVEL) then
       if(newLevel >= noblelevel) then
           if(getPlayerStorageValue(cid, noblestorage) == -1)then 
               doPlayerAddOutfit(cid, 140, 3)
               doPlayerAddOutfit(cid, 132, 3)
               setPlayerStorageValue(cid, noblestorage, 1)
               doPlayerSendTextMessage(cid, TextType, nobletext)
               end
       end
   end
--- Summoner ---    
   if (skill == SKILL__LEVEL) then
       if(newLevel >= summonerlevel) then
           if(getPlayerStorageValue(cid, summonerstorage) == -1)then 
               doPlayerAddOutfit(cid, 141, 3)
               doPlayerAddOutfit(cid, 133, 3)
               setPlayerStorageValue(cid, summonerstorage, 1)
               doPlayerSendTextMessage(cid, TextType, summonertext)
               end
       end
   end
   --- Warrior ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Warriorlevel) then
           if(getPlayerStorageValue(cid, Warriorstorage) == -1)then 
               doPlayerAddOutfit(cid, 142, 3)
               doPlayerAddOutfit(cid, 134, 3)
               setPlayerStorageValue(cid, Warriorstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Warriortext)
               end
       end
   end
   --- Barbarian ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Barbarianlevel) then
           if(getPlayerStorageValue(cid, Barbarianstorage) == -1)then 
               doPlayerAddOutfit(cid, 147, 3)
               doPlayerAddOutfit(cid, 143, 3)
               setPlayerStorageValue(cid, Barbarianstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Barbariantext)
               end
       end
   end
   --- Druid ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Druidlevel) then
           if(getPlayerStorageValue(cid, Druidstorage) == -1)then 
               doPlayerAddOutfit(cid, 148, 3)
               doPlayerAddOutfit(cid, 144, 3)
               setPlayerStorageValue(cid, Druidstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Druidtext)
               end
       end
   end
   --- Wizard ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Wizardlevel) then
           if(getPlayerStorageValue(cid, Wizardstorage) == -1)then 
               doPlayerAddOutfit(cid, 149, 3)
               doPlayerAddOutfit(cid, 145, 3)
               setPlayerStorageValue(cid, Wizardstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Wizardtext)
               end
       end
   end
   --- Oriental ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Orientallevel) then
           if(getPlayerStorageValue(cid, Orientalstorage) == -1)then 
               doPlayerAddOutfit(cid, 150, 3)
               doPlayerAddOutfit(cid, 146, 3)
               setPlayerStorageValue(cid, Orientalstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Orientaltext)
               end
       end
   end
   --- Pirate ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Piratelevel) then
           if(getPlayerStorageValue(cid, Piratestorage) == -1)then 
               doPlayerAddOutfit(cid, 155, 3)
               doPlayerAddOutfit(cid, 151, 3)
               setPlayerStorageValue(cid, Piratestorage, 1)
               doPlayerSendTextMessage(cid, TextType, Piratetext)
               end
       end
   end
   --- Assassin ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Assassinlevel) then
           if(getPlayerStorageValue(cid, Assassinstorage) == -1)then 
               doPlayerAddOutfit(cid, 156, 3)
               doPlayerAddOutfit(cid, 152, 3)
               setPlayerStorageValue(cid, Assassinstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Assassintext)
               end
       end
   end
   --- Beggar ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Beggarlevel) then
           if(getPlayerStorageValue(cid, Beggarstorage) == -1)then 
               doPlayerAddOutfit(cid, 157, 3)
               doPlayerAddOutfit(cid, 153, 3)
               setPlayerStorageValue(cid, Beggarstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Beggartext)
               end
       end
   end
   --- Shaman ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Shamanlevel) then
           if(getPlayerStorageValue(cid, Shamanstorage) == -1)then 
               doPlayerAddOutfit(cid, 158, 3)
               doPlayerAddOutfit(cid, 154, 3)
               setPlayerStorageValue(cid, Shamanstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Shamantext)
               end
       end
   end
   --- Norse ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Norselevel) then
           if(getPlayerStorageValue(cid, Norsestorage) == -1)then 
               doPlayerAddOutfit(cid, 252, 3)
               doPlayerAddOutfit(cid, 251, 3)
               setPlayerStorageValue(cid, Norsestorage, 1)
               doPlayerSendTextMessage(cid, TextType, Norsetext)
               end
       end
   end
   --- Nightmare ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Nightmarelevel) then
           if(getPlayerStorageValue(cid, Nightmarestorage) == -1)then 
               doPlayerAddOutfit(cid, 269, 3)
               doPlayerAddOutfit(cid, 268, 3)
               setPlayerStorageValue(cid, Nightmarestorage, 1)
               doPlayerSendTextMessage(cid, TextType, Nightmaretext)
               end
       end
   end
   --- Jester ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Jesterlevel) then
           if(getPlayerStorageValue(cid, Jesterstorage) == -1)then 
               doPlayerAddOutfit(cid, 270, 3)
               doPlayerAddOutfit(cid, 273, 3)
               setPlayerStorageValue(cid, Jesterstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Jestertext)
               end
       end
   end
   --- Brotherhood ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Brotherhoodlevel) then
           if(getPlayerStorageValue(cid, Brotherhoodstorage) == -1)then 
               doPlayerAddOutfit(cid, 279, 3)
               doPlayerAddOutfit(cid, 278, 3)
               setPlayerStorageValue(cid, Brotherhoodstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Brotherhoodtext)
               end
       end
   end
   --- Demonhunter ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Demonhunterlevel) then
           if(getPlayerStorageValue(cid, Demonhunterstorage) == -1)then 
               doPlayerAddOutfit(cid, 288, 3)
               doPlayerAddOutfit(cid, 289, 3)
               setPlayerStorageValue(cid, Demonhunterstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Demonhuntertext)
               end
       end
   end
   --- Yalaharian ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Yalaharianlevel) then
           if(getPlayerStorageValue(cid, Yalaharianstorage) == -1)then 
               doPlayerAddOutfit(cid, 324, 3)
               doPlayerAddOutfit(cid, 325, 3)
               setPlayerStorageValue(cid, Yalaharianstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Yalahariantext)
               end
       end
   end
   --- Warmaster ---
   if (skill == SKILL__LEVEL) then
       if(newLevel >= Warmasterlevel) then
           if(getPlayerStorageValue(cid, Warmasterstorage) == -1)then 
               doPlayerAddOutfit(cid, 336, 3)
               doPlayerAddOutfit(cid, 335, 3)
               setPlayerStorageValue(cid, Warmasterstorage, 1)
               doPlayerSendTextMessage(cid, TextType, Warmastertext)
               end
       end
   end


   return true
   end

Editado por Black Ice

Compartilhar este post


Link para o post
Antharaz    4
Antharaz

Apesar de que poderia ter tornado o scrip MUITO mais organizado e fácil de se configurar usando tables, vou aprovar.

 

Como eu faria:

 

[spoiler=Script reduzido]

local config={{addon={136,128},level=30,stor=11500,name="citizen"},
{addon={137,129},level=50,stor=11505,name="hunter"},
{addon={138,130},level=60,stor=11510,name="mage"},
{addon={139,131},level=70,stor=11515,name="knight"},
{addon={140,132},level=90,stor=11520,name="Noble"},
{addon={141,133},level=100,stor=11525,name="summoner"},
{addon={142,134},level=120,stor=11530,name="warrior"},
{addon={147,143},level=125,stor=11605,name="barbarian"},
{addon={148,144},level=130,stor=11535,name="druid"},
{addon={149,145},level=135,stor=11540,name="wizard"},
{addon={150,146},level=150,stor=11545,name="oriental"},
{addon={155,151},level=155,stor=11550,name="pirate"},
{addon={156,152},level=170,stor=11555,name="assassin"},
{addon={157,153},level=175,stor=11560,name="beggar"},
{addon={158,154},level=270,stor=11565,name="shaman"},
{addon={252,251},level=180,stor=11570,name="norse"},
{addon={269,269},level=190,stor=11575,name="nightmare"},
{addon={270,273},level=200,stor=11580,name="jester"},
{addon={279,278},level=220,stor=11585,name="brotherhood"},
{addon={288,289},level=240,stor=11590,name="demonhunter"},
{addon={324,325},level=245,stor=11595,name="yalaharian"},
{addon={336,335},level=260,stor=11600,name="warmaster"},
}

function onAdvance(cid, skill, oldLevel, newLevel)

for x=1,#config do
	if skill == SKILL__LEVEL and newLevel >= config[x].level and getPlayerStorageValue(cid, config[x].stor) == -1 then 
		doPlayerAddOutfit(cid, config[x].addon[1], 3)
		doPlayerAddOutfit(cid, config[x].addon[2], 3)
		setPlayerStorageValue(cid, config[x].stor, 1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have now "..config[x].name.." addons.")
		break
	end
end
return true
end

 

Compartilhar este post


Link para o post
Zaffend    0
Zaffend

Oia dps dessa...

SHOW manin...

Vo inu nessa...

bye :D

Compartilhar este post


Link para o post
DarkGladiators    0
DarkGladiators

Boa manolo, idéia bacana.

Mas uma pequena dúvida: tem como adicionar um outfit que não esteja configurado no outfits.xml?

Por exemplo: ao alcansar level 200 o player receberá o outfit de assassin, que não está no xml para que o player não tenha acesso ao addon antes de alcansar o level.

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×