samandriel
Active Member
- Joined
- Oct 19, 2016
- Messages
- 242
- Solutions
- 1
- Reaction score
- 46
I'm doing dawnport in my server 8.6 with that tiles where players change vocation.
And you guys should use it too, dawnport is more fun then rook if u want to go to next island...
It's working, but there is 2 things that idk how to do and need some help:
1- setplayercap
i dont found nothing about it on forum and not even in my sources Fir3element/3777 (https://github.com/Fir3element/3777/tree/master/src)
so what should i do?
2- convert player Skills / ML
it's being a problem, a player can choose mage, train his ML until 20 and go back to knight with ML 20
same to mage, player can train shield 70 and back to mage
i need to convert back players skills / ml on change vocation
full script?
And you guys should use it too, dawnport is more fun then rook if u want to go to next island...
It's working, but there is 2 things that idk how to do and need some help:
1- setplayercap
i dont found nothing about it on forum and not even in my sources Fir3element/3777 (https://github.com/Fir3element/3777/tree/master/src)
so what should i do?
2- convert player Skills / ML
it's being a problem, a player can choose mage, train his ML until 20 and go back to knight with ML 20
same to mage, player can train shield 70 and back to mage
i need to convert back players skills / ml on change vocation
full script?
Code:
local tile = {
--[actionid] = {vocation id}
[65530] = {
vocid = 1,
weaponID = 2190, -- wand of vortex
extraItems = {
{itemID = 2260, count = 10}, -- blank rune
{itemID = 2287, count = 30} -- lmm
}
},
[65529] = {
vocid = 2,
weaponID = 2182, -- snakebite rod
extraItems = {
{itemID = 2260, count = 10}, -- blank rune
{itemID = 2287, count = 30} -- lmm
}
},
[65528] = {
vocid = 3,
weaponID = 2456, -- bow
extraItems = {
{itemID = 2544, count = 100}, -- arrows
{itemID = 2389, count = 3} -- spear
}
},
[65527] = {
vocid = 4,
extraItems = {
{itemID = 2379, count = 1}, -- sword
{itemID = 2382, count = 1}, -- axe
{itemID = 2380, count = 1} -- club
}
}
}
function onStepIn(cid, item, position, fromPosition)
local r = tile[item.actionid]
if not r then
return true
end
local townid = 7
local pos = {x= 392, y=929, z=6}
local extralvls = getPlayerLevel(cid) - 1
local vocation
local cap
local hp
local mp
if item.actionid == 65530 then -- sorc
doPlayerSetVocation(cid, 1)
hp = (185) + (extralvls * 5)
mp = (35) + (extralvls * 30)
cap = (400) + (extralvls * 10)
-- ???convert ML and SKILLS???
elseif item.actionid == 65529 then -- druid
doPlayerSetVocation(cid, 2)
hp = (185) + (extralvls * 5)
mp = (35) + (extralvls * 30)
cap = (400) + (extralvls * 10)
-- ???convert ML and SKILLS???
elseif item.actionid == 65528 then -- pally
doPlayerSetVocation(cid, 3)
hp = (185) + (extralvls * 10)
mp = (35) + (extralvls * 15)
cap = (400) + (extralvls * 20)
-- ???convert ML and SKILLS???
elseif item.actionid == 65527 then -- kina
doPlayerSetVocation(cid, 4)
hp = (185) + (extralvls * 15)
mp = (35) + (extralvls * 5)
cap = (400) + (extralvls * 25)
-- ???convert ML and SKILLS???
end
-- add stuff
setCreatureMaxHealth(cid, hp)
setCreatureMaxMana(cid, mp)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), false)
doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
doTeleportThing(cid, pos)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSetTown(cid, townid)
-- ???setplayerCAP???
-- add items
-- already recived
local queststatus = getPlayerStorageValue(cid, item.actionid)
if queststatus ~= -1 then
return true
end
-- add items
-- weapon first
if r.weaponID then
doPlayerAddItem(cid, r.weaponID, 1)
end
-- other stuffs
if r.extraItems then
for i=1,#r.extraItems do
local item,count = r.extraItems[i].itemID, r.extraItems[i].count
doPlayerAddItem(cid, item, count)
end
end
setPlayerStorageValue(cid,item.actionid,1)
return true
end