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

help with thing of my server

PilaSOnE

New Member
Joined
May 10, 2009
Messages
8
Reaction score
0
hello i am creating a 8.6 server with emporia pack,i have things that i want to change.

1- on darashia carpet,the npc only say for go to svargrond,edron and femon hills,then,how can the players can go to farmine if the carpet dont say for go to farmine on this server?

2-how can i put that if i reach level 20 i recibe 2cc?

3-i want that if i level up i get full hp and mana

thanks and greetings
 
Last edited:
1. Search for the NPC in data/npc and open it and check the script.lua, and edit it in data/npc/scripts.

2. Create a new file in creaturescripts/scripts called 20lvl.lua:
Code:
local t = {}
 
local money = 2 -- amount of cc
 
function onAdvance(cid, type, oldlevel, newlevel)
   if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
   if (newlevel >= 20 and getPlayerStorageValue(cid, 12345) == -1) then
        local p = doPlayerAddItem(cid,2160,2)
    doSendAnimatedText(pos, '2 Crystal!', RED)
    setPlayerStorageValue(cid, 12345, 1)
  end
  end
  return true
end

Add this to creaturescripts.xml:

Code:
<event type="advance" name="20reward" event="script" value="20lvl.lua"/>

and add this on creaturescripts/login.lua:

Code:
registerCreatureEvent(cid, "20reward")

3. Also in creaturescripts, make a new file called lvlup.lua with this:

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getCreaturePosition(cid)
if skill == SKILL__LEVEL then
	doPlayerAddHealth(cid,getCreatureMaxHealth(cid))
	doPlayerAddMana(cid,getCreatureMaxMana(cid))
elseif skill == SKILL__MAGLEVEL then
	doPlayerAddMana(cid,getCreatureMaxMana(cid)-getCreatureMana(cid))
end
return true
end

Add this on creaturescripts.xml:

Code:
<event type="advance" name="lvlup" event="script" value="lvlup.lua"/>

and this on login.lua too:

Code:
registerCreatureEvent(cid,'lvlup')

Good Luck :].
 
1. Search for the NPC in data/npc and open it and check the script.lua, and edit it in data/npc/scripts.

2. Create a new file in creaturescripts/scripts called 20lvl.lua:
Code:
local t = {}
 
local money = 2 -- amount of cc
 
function onAdvance(cid, type, oldlevel, newlevel)
   if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
   if (newlevel >= 20 and getPlayerStorageValue(cid, 12345) == -1) then
        local p = doPlayerAddItem(cid,2160,2)
    doSendAnimatedText(pos, '2 Crystal!', RED)
    setPlayerStorageValue(cid, 12345, 1)
  end
  end
  return true
end

Add this to creaturescripts.xml:

Code:
<event type="advance" name="20reward" event="script" value="20lvl.lua"/>

and add this on creaturescripts/login.lua:

Code:
registerCreatureEvent(cid, "20reward")

3. Also in creaturescripts, make a new file called lvlup.lua with this:

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getCreaturePosition(cid)
if skill == SKILL__LEVEL then
	doPlayerAddHealth(cid,getCreatureMaxHealth(cid))
	doPlayerAddMana(cid,getCreatureMaxMana(cid))
elseif skill == SKILL__MAGLEVEL then
	doPlayerAddMana(cid,getCreatureMaxMana(cid)-getCreatureMana(cid))
end
return true
end

Add this on creaturescripts.xml:

Code:
<event type="advance" name="lvlup" event="script" value="lvlup.lua"/>

and this on login.lua too:

Code:
registerCreatureEvent(cid,'lvlup')

Good Luck :].

thanks for helping me but i have a problem with the npc carpet of darashia,i have the npc chelmar and this is his script

code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Edron for 40 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33193, y=31784, z=3} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Svargrond for 60 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32253, y=31097, z=4} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

local travelNode = keywordHandler:addKeyword({'femor hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32536, y=31837, z=4} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32536, y=31837, z=4} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})


npcHandler:addModule(FocusModule:new())

but on other svs if i talk with this npc and say farmine,i go to other npc that his name is Melian but i dont have this npc on npcs :(
 
Just add another like this:

Code:
local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32536, y=31837, z=4} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

In the same NPC file.. you edit the text, and the position.
 
Just add another like this:

Code:
local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32536, y=31837, z=4} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

In the same NPC file.. you edit the text, and the position.


yeah but i dont have the cordenates of the farmines carpet because i dont have the farmine carpet on npcs,how can i do it?i cant view where is the site of farmine carpet for get the position :/

i only know that the npc name is Melian

pd:in remeres map i have for put melian,now i need the correct position of this npc
 
Last edited:
In remere's you can look the position that you want to tped when saying 'farmine'

now i have farmine,but i need the npc lua and xml of melian,

can u help me to put this npc with his system and with this outfit?

Melian - TibiaWiki - Quests, Items, Spells, and more

other thing,normaly on servers,where is the lua for change the start items?

thanks for help

PD: when i lvl up i dont get full hp and mp,only get full mp if i level up my magic level xD
 
Last edited:
Back
Top