• 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 on on this script

zoky12

New Member
Joined
Jul 4, 2008
Messages
60
Reaction score
0
function onLogin(cid)
local townpos = {x = 1028, y = 1020, z = 7}
local serverName = getConfigValue('serverName')
local start_pos = getConfigValue('start_pos')
local points = getConfigValue('points')
local start_pos_player = start_pos[math.random(1, #start_pos)]
local text = "Welcome to war server, here a list with commands:\n!online -> See online players\n!uptime -> See server uptime\n!ranks -> See server highscores (example: !ranks level)\n Multi-Client is not allowed in Delton War!!\n If use MC = auto logout\n//!"

--------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG START ||--------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

config = {
Level = 120
}
sorc = {
Leben = 745,
Mana = 3395,
MagicLevel = 15,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 24
}
druid = {
Leben = 745,
Mana = 3395,
MagicLevel = 15,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 24
}
paladin = {
Leben = 1305,
Mana = 1715,
MagicLevel = 5,
Cap = 2710,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 99,
Shield = 70
}
knight = {
Leben = 1865,
Mana = 595,
MagicLevel = 4,
Cap = 3270,
Fist = 10,
Club = 10,
Sword = 126,
Axe = 126,
Dist = 10,
Shield = 94
}

---------------------------------------------------------|
--------------- ITMES -----------------------------------|
---------------------------------------------------------|

sorcereritems = {
2196, -- Amulet of loss
2187, -- wand of inferno
8918, -- phoenix shield
2175, -- spellbook
8890, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
2167, -- energy ring
10521, -- backpack
6132 -- soft boots
}
druiditems = {
2196, -- Amulet of loss
8910, -- hailstorm rod
8918, -- phoenix shield
2175, -- spellbook
8866, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
2167, -- energy ring
10521, -- backpack
6132, -- soft boots
2269 -- wild grouth rune
}
paladinitems = {
2196, -- Amulet of loss
2520, -- demon shield
6529, -- spellbook
8888, -- crown armor
9777, -- crown legs
2493, -- crown helmet
2195, -- boots of haste
2164, -- might ring
10522, -- backpack
8472, -- great spirit portion
8850, --
8851, --
6132 -- soft boots
}
knightitems = {
2196, -- Amulet of loss
6433, -- mastermind shield
2400, -- magic sword
8925, -- spellbook
9776, -- golden armor
2470, -- golden legs
2471, -- golden helmet
2195, -- boots of haste
2210, -- sword ring
10518, -- backpack
6132 -- soft boots
}
---------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG END ||----------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

-- vocation -----
sorcVoc = 1
druidVoc = 2
palaVoc = 3
knightVoc = 4
-----------------

if getCreatureName(cid) ~= "Account Manager" and getPlayerGroupId(cid) == 1 then
if getPlayerVocation(cid) == sorcVoc then
voc = sorc
elseif getPlayerVocation(cid) == druidVoc then
voc = druid
elseif getPlayerVocation(cid) == palaVoc then
voc = paladin
elseif getPlayerVocation(cid) == knightVoc then
voc = knight
end
if getPlayerStorageValue(cid,points) == -1 then
setPlayerStorageValue(cid,points,0)
end
setCreatureMaxHealth(cid,voc.Leben)
setCreatureMaxMana(cid,voc.Mana)
db.executeQuery("UPDATE `players` SET `level` = "..config.Level.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
db.executeQuery("UPDATE `players` SET `cap` = "..voc.Cap.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
voc = nil
-- Outfit, Teleport, Text --
if getPlayerSex(cid) == 1 then
outfit = outfit_male
elseif getPlayerSex(cid) ~= 1 then
outfit = outfit_female
end
doCreatureAddHealth(cid,getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid)-getCreatureMana(cid))
doTeleportThing(cid, townpos, true)
player_pos = getCreaturePosition(cid)
doSendMagicEffect(player_pos,10)
doPlayerPopupFYI(cid, text)
-----------
-- Items --
if getPlayerVocation(cid) == sorcVoc and getPlayerStorageValue(cid,5000) == -1 then
for i = 1, table.maxn(sorcereritems) do
doPlayerAddItem(cid, sorcereritems, 1)
setPlayerStorageValue(cid,5000,1)
end
elseif getPlayerVocation(cid) == druidVoc and getPlayerStorageValue(cid,5000) == -1 then
for i = 1, table.maxn(druiditems) do
doPlayerAddItem(cid, druiditems, 1)
end
elseif getPlayerVocation(cid) == palaVoc and getPlayerStorageValue(cid,5000) == -1 then
doPlayerAddItem(cid,7368,100) -- 100 assassin star
for i = 1, table.maxn(paladinitems) do
doPlayerAddItem(cid, paladinitems, 1)
setPlayerStorageValue(cid,5000,1)
end
elseif getPlayerVocation(cid) == knightVoc and getPlayerStorageValue(cid,5000) == -1 then
for i = 1, table.maxn(knightitems) do
doPlayerAddItem(cid, knightitems, 1)
setPlayerStorageValue(cid,5000,1)
end
end
-- All --
if getPlayerStorageValue(cid,5001) == -1 then
local bag1 = doPlayerAddItem(cid, 2000, 1)
doAddContainerItem(bag1, 8704, 1)
doAddContainerItem(bag1, 7618, 1)
doAddContainerItem(bag1, 7588, 1)
doAddContainerItem(bag1, 7591, 1)
doAddContainerItem(bag1, 8473, 1)
doAddContainerItem(bag1, 2273, 1)
local bag2 = doPlayerAddItem(cid, 2001, 1)
doAddContainerItem(bag2, 7620, 1)
doAddContainerItem(bag2, 7589, 1)
doAddContainerItem(bag2, 7590, 1)
local bag3 = doPlayerAddItem(cid, 1998, 1)
doAddContainerItem(bag3, 2293, 1)
doAddContainerItem(bag3, 2278, 1)
doAddContainerItem(bag3, 2262, 1)
doAddContainerItem(bag3, 2305, 1)
doAddContainerItem(bag3, 2261, 1)
doAddContainerItem(bag3, 2303, 1)
doAddContainerItem(bag3, 2279, 1)
doAddContainerItem(bag3, 2313, 1)
doAddContainerItem(bag3, 2268, 1)
doAddContainerItem(bag3, 2262, 1)
setPlayerStorageValue(cid,5001,1)
end
--------
end
return TRUE
end


i am willing to suck dick for someone to fix this script. Problem: the sorc and druid keep duplciating there gear on death
 
Lua:
function onLogin(cid)
local townpos = {x = 1028, y = 1020, z = 7}
local serverName = getConfigValue('serverName')
local start_pos = getConfigValue('start_pos')
local points = getConfigValue('points')
local start_pos_player = start_pos[math.random(1, #start_pos)]
local text = "Welcome to war server, here a list with commands:\n!online -> See online players\n!uptime -> See server uptime\n!ranks -> See server highscores (example: !ranks level)\n Multi-Client is not allowed in Delton War!!\n If use MC = auto logout\n//!"

--------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG START ||--------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

config = {
Level = 120
}
sorc = {
Leben = 745,
Mana = 3395,
MagicLevel = 15,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 24
}
druid = {
Leben = 745,
Mana = 3395,
MagicLevel = 15,
Cap = 1590,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 10,
Shield = 24
}
paladin = {
Leben = 1305,
Mana = 1715,
MagicLevel = 5,
Cap = 2710,
Fist = 10,
Club = 10,
Sword = 10,
Axe = 10,
Dist = 99,
Shield = 70
}
knight = {
Leben = 1865,
Mana = 595,
MagicLevel = 4,
Cap = 3270,
Fist = 10,
Club = 10,
Sword = 126,
Axe = 126,
Dist = 10,
Shield = 94
}

---------------------------------------------------------|
--------------- ITMES -----------------------------------|
---------------------------------------------------------|

sorcereritems = {
2196, -- Amulet of loss
2187, -- wand of inferno
8918, -- phoenix shield
2175, -- spellbook
8890, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
2167, -- energy ring
10521, -- backpack
6132 -- soft boots
}
druiditems = {
2196, -- Amulet of loss
8910, -- hailstorm rod
8918, -- phoenix shield
2175, -- spellbook
8866, -- blue robe
7730, -- blue legs
9778, -- magician hat
2195, -- boots of haste
2167, -- energy ring
10521, -- backpack
6132, -- soft boots
2269 -- wild grouth rune
}
paladinitems = {
2196, -- Amulet of loss
2520, -- demon shield
6529, -- spellbook
8888, -- crown armor
9777, -- crown legs
2493, -- crown helmet
2195, -- boots of haste
2164, -- might ring
10522, -- backpack
8472, -- great spirit portion
8850, --
8851, --
6132 -- soft boots
}
knightitems = {
2196, -- Amulet of loss
6433, -- mastermind shield
2400, -- magic sword
8925, -- spellbook
9776, -- golden armor
2470, -- golden legs
2471, -- golden helmet
2195, -- boots of haste
2210, -- sword ring
10518, -- backpack
6132 -- soft boots
}
---------------------------------------------------------------------------------------------------------------|
-------------|| CONFIG END ||----------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------------------|

-- vocation -----
sorcVoc = 1
druidVoc = 2
palaVoc = 3
knightVoc = 4
-----------------

if getCreatureName(cid) ~= "Account Manager" and getPlayerGroupId(cid) == 1 then
if getPlayerVocation(cid) == sorcVoc then
voc = sorc
elseif getPlayerVocation(cid) == druidVoc then
voc = druid
elseif getPlayerVocation(cid) == palaVoc then
voc = paladin
elseif getPlayerVocation(cid) == knightVoc then
voc = knight
end
if getPlayerStorageValue(cid,points) == -1 then
setPlayerStorageValue(cid,points,0)
end
setCreatureMaxHealth(cid,voc.Leben)
setCreatureMaxMana(cid,voc.Mana)
db.executeQuery("UPDATE `players` SET `level` = "..config.Level.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
db.executeQuery("UPDATE `players` SET `cap` = "..voc.Cap.." WHERE `name` = '" .. getCreatureName(cid) .. "';")
voc = nil
-- Outfit, Teleport, Text --
if getPlayerSex(cid) == 1 then
outfit = outfit_male
elseif getPlayerSex(cid) ~= 1 then
outfit = outfit_female
end
doCreatureAddHealth(cid,getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid)-getCreatureMana(cid))
doTeleportThing(cid, townpos, true)
player_pos = getCreaturePosition(cid)
doSendMagicEffect(player_pos,10)
doPlayerPopupFYI(cid, text)
-----------
-- Items --
if getPlayerVocation(cid) == sorcVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(sorcereritems) do
doPlayerAddItem(cid, sorcereritems[i], 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == druidVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(druiditems) do
doPlayerAddItem(cid, druiditems[i], 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == palaVoc and getPlayerStorageValue(cid,5001) == -1 then
doPlayerAddItem(cid,7368,100) -- 100 assassin star
for i = 1, table.maxn(paladinitems) do
doPlayerAddItem(cid, paladinitems[i], 1)
setPlayerStorageValue(cid,5001,1)
end
elseif getPlayerVocation(cid) == knightVoc and getPlayerStorageValue(cid,5001) == -1 then
for i = 1, table.maxn(knightitems) do
doPlayerAddItem(cid, knightitems[i], 1)
setPlayerStorageValue(cid,5001,1)
end
end
-- All --
if getPlayerStorageValue(cid,5000) == -1 then
local bag1 = doPlayerAddItem(cid, 2000, 1)
doAddContainerItem(bag1, 8704, 1)
doAddContainerItem(bag1, 7618, 1)
doAddContainerItem(bag1, 7588, 1)
doAddContainerItem(bag1, 7591, 1)
doAddContainerItem(bag1, 8473, 1)
doAddContainerItem(bag1, 2273, 1)
local bag2 = doPlayerAddItem(cid, 2001, 1)
doAddContainerItem(bag2, 7620, 1)
doAddContainerItem(bag2, 7589, 1)
doAddContainerItem(bag2, 7590, 1)
local bag3 = doPlayerAddItem(cid, 1998, 1)
doAddContainerItem(bag3, 2293, 1)
doAddContainerItem(bag3, 2278, 1)
doAddContainerItem(bag3, 2262, 1)
doAddContainerItem(bag3, 2305, 1)
doAddContainerItem(bag3, 2261, 1)
doAddContainerItem(bag3, 2303, 1)
doAddContainerItem(bag3, 2279, 1)
doAddContainerItem(bag3, 2313, 1)
doAddContainerItem(bag3, 2268, 1)
doAddContainerItem(bag3, 2262, 1)
setPlayerStorageValue(cid,5000,1)
end
--------
end
return TRUE
end
 
If it work,I will rep you forever

[02/09/2009 06:23:15] data/creaturescripts/scripts/items2 (2).lua:6: attempt to get length of local 'start_pos' (a nil value)
[02/09/2009 06:23:15] stack traceback:
[02/09/2009 06:23:15] data/creaturescripts/scripts/items2 (2).lua:6: in function <data/creaturescripts/scripts/items2 (2).lua:1>

Wow,Thanks very much!

EDIT:
Anyone could fix it so it changed lvl too?:p!
because sql query cant be exucuted when char is online -.-!
 
Last edited by a moderator:
EDIT:
Anyone could fix it so it changed lvl too?:p!
because sql query cant be exucuted when char is online -.-!

use gesiors aac and make all the sample chars level 120 with whatever skills you want. then use a simple firstitems script for the items..this script really isnt necessary :)
 
Back
Top Bottom