• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows In Game AAC

blazzinn

New Member
Joined
Dec 24, 2012
Messages
68
Reaction score
1
i was woundering how to get the ingame aac to put items on the characters when made or is this is possible..

also was woundering how to make it so when a player dies they dont lose anything or when they die and relog they still have same eq as before kinda for a war server if i could get some help that be awesome thx
 
1. You can try a MOD, this: http://otland.net/f163/mod-first-items-99737/
2. You can try adding simple functions into your login.lua. like:

LUA:
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
end
 
i found this code and used it
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
<config name="firstitems_config"><![CDATA[
STORAGE = 30001
commonItems = {
{itemid=2152, count=0, inContainer = true}, -- 25 platinum coins
{itemid=2195}, count=1, inContainer = true}, -- leather boots
{itemid=2173}, count=1, inContainer = true}, -- aol
{itemid=2293}, count=1, inContainer = true}, -- m WALL
{itemid=2269}, count=1, inContainer = true}, -- t WALL
{itemid=2273}, count=1, inContainer = true}, -- uh
{itemid=2261}, count=1, inContainer = true}, -- D Field
{itemid=2268}, count=1, inContainer = true}, -- SD
{itemid=2301}, count=1, inContainer = true}, -- F Field
{itemid=7589}, count=1, inContainer = true}, -- SMP
{itemid=7590}, count=1, inContainer = true}, -- GMP
{itemid=7620}, count=1, inContainer = true}, -- Mp
{itemid=2120}, count=1, inContainer = true}, -- rope
}
firstItems = {
{ -- Master Sorcerer
{itemid=1988}, -- backpack
{itemid=8918}, -- spellbook
{itemid=8922}, -- wand of vortex
{itemid=7899}, -- magician's robe
{itemid=2323}, -- mage hat
{itemid=7894} -- chain legs
},
{ -- Elder Druid
{itemid=1988}, -- backpack
{itemid=8918}, -- spellbook
{itemid=2183}, -- snakebite rod
{itemid=7897}, -- magician's robe
{itemid=2323}, -- mage hat
{itemid=7896} -- chain legs
},
{ -- Royal Paladin
{itemid=1988}, -- backpack
{itemid=2522}, -- dwarven shield
{itemid=7368, count=1}, -- 3 spears
{itemid=2466}, -- plate armor
{itemid=2493}, -- steel helmet
{itemid=2470} -- plate legs
},
{ -- Elite Knight
{itemid=1988}, -- backpack
{itemid=2522}, -- dwarven shield
{itemid=8925}, -- spike sword
{itemid=2494}, -- plate armor
{itemid=2493}, -- steel helmet
{itemid=2469} -- plate legs
}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')

for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end

function onLogin(cid)
if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
if isItemContainer(v.itemid) then
backpack = doPlayerAddItem(cid, v.itemid, 1)
elseif v.inContainer then
doAddContainerItem(backpack, v.itemid, v.count or 1)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
setPlayerStorageValue(cid, STORAGE, 1)
end
return true
end
]]></event>
</mod>

but i get this error when starting server

[05/02/2013 16:16:16] [string "loadBuffer"]:3: bad argument #1 to 'ipairs' (table expected, got nil)
[05/02/2013 16:16:16] [Warning - Event::loadScript] Cannot load script ( domodlib('firstitems_config')
[05/02/2013 16:16:16]
[05/02/2013 16:16:16] for _, items in ipairs(firstItems) do
[05/02/2013 16:16:16] for _, item in ipairs(commonItems) do
[05/02/2013 16:16:16] table.insert(items, item)
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16]
[05/02/2013 16:16:16] function onLogin(cid)
[05/02/2013 16:16:16] if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
[05/02/2013 16:16:16] for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
[05/02/2013 16:16:16] if isItemContainer(v.itemid) then
[05/02/2013 16:16:16] backpack = doPlayerAddItem(cid, v.itemid, 1)
[05/02/2013 16:16:16] elseif v.inContainer then
[05/02/2013 16:16:16] doAddContainerItem(backpack, v.itemid, v.count or 1)
[05/02/2013 16:16:16] else
[05/02/2013 16:16:16] doPlayerAddItem(cid, v.itemid, v.count or 1)
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16] setPlayerStorageValue(cid, STORAGE, 1)
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16] return true
[05/02/2013 16:16:16] end
[05/02/2013 16:16:16] )
[05/02/2013 16:16:16] data/creaturescripts/scripts/login.lua:53: '<eof>' expected near 'end'
 
Last edited:
Back
Top