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

Donation items problem

Venn

Member
Joined
Aug 16, 2009
Messages
547
Reaction score
20
Hello,
i got some problem
i have creat a donation items which looks like that:

in items xml:
Code:
    <item id="12568" article="a" name="elite draken mail">
        <attribute key="weight" value="12000" />
        <attribute key="armor" value="15" />
    <attribute key="skillSword" value="3" />
    <attribute key="skillAxe" value="3" />
    <attribute key="skillClub" value="3" />
    <attribute key="speed" value="10" />
        <attribute key="slotType" value="body" />
    <attribute key="decayTo" value="0"/>
    <attribute key="duration" value="180000"/>
    <attribute key="showduration" value="1" />
    </item>

and in movements:
Code:
    <movevent type="Equip" itemid="12568" slot="armor" event="function" value="onEquipItem">    <!-- elite draken mail -->
        <vocation id="4"/>
        <vocation id="8" showInDescription="0"/>
        <vocation id="12" showInDescription="0"/>
    <movevent type="DeEquip" itemid="12568" slot="armor" event="function" value="onDeEquipItem"/>    <!-- elite draken mail -->
    </movevent>

but it not working good.
it should disappear after 3000 minutes and add some skill when waring.
but it waork like that when i war it i got +3skills and when i take town armor skills are not getting back still got +3skills, when i war it again nothing happend, but if i wear palladin armor i will not get +2dist but when i take it down i got -2dist - so if i got 10 dist i war paladin armor and take down and finally got 8 dist.
if i wear donation item i got +3 skill and wear paladin got -2 dist if i will war it like
donation>paladin>donation>paladin [...]
my skill will growing up and dist will gettin less.
how can i fix that ?
 
Change:
XML:
    <movevent type="Equip" itemid="12568" slot="armor" event="function" value="onEquipItem">    <!-- elite draken mail -->
        <vocation id="4"/>
        <vocation id="8" showInDescription="0"/>
        <vocation id="12" showInDescription="0"/>
    <movevent type="DeEquip" itemid="12568" slot="armor" event="function" value="onDeEquipItem"/>    <!-- elite draken mail -->
    </movevent>
to:
XML:
	<movevent type="Equip" itemid="12568" slot="armor" event="function" value="onEquipItem"> <!-- elite draken mail -->
		<vocation id="4"/>
		<vocation id="8" showInDescription="0"/>
		<vocation id="12" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="12568" slot="armor" event="function" value="onDeEquipItem"/> <!-- elite draken mail -->
 
thanks it work fine now :) rep
so what about this bug in gesior acc ?
Code:
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in D:\Program Files\xampp\htdocs\pot\OTS_Player.php:1786 Stack trace: #0 D:\Program Files\xampp\htdocs\accountmanagement.php(803): OTS_Player->getSkill(0) #1 D:\Program Files\xampp\htdocs\index.php(181): include('D:\Program File...') #2 {main} thrown in D:\Program Files\xampp\htdocs\pot\OTS_Player.php on line 1786
when i try to creat character i got this error
but character is created.
how to fix that ?
 
thanks it work! :D
and thats last bug what i got
i want to fix that

i got error
xncj6t.jpg

how to fix that ?

oracle_check.lua
Code:
local oracleItems = 9011
    if getPlayerStorageValue(cid,oracleItems) < 1 then
      itemThinker(cid)
    end
 
function itemThinker(cid)
    local backpack = doCreateItemEx(1988, 1)
    local giveItems = firstItems[getPlayerVocation(cid)]
    if giveItems ~= nil then
        for _, v in ipairs(giveItems) do
            doAddContainerItem(backpack, v.itemid, v.count or 1)
        end
        local addItem = doPlayerAddItemEx(cid, backpack, 0)
        if (addItem == RETURNVALUE_NOERROR and getPlayerStorageValue(cid,9011) < 1) then
            setPlayerStorageValue(cid,9011,1)
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You recieved items from the Oracle.')
            return true
        elseif (addItem == RETURNVALUE_NOTENOUGHCAPACITY and getPlayerStorageValue(cid,9011) < 1) then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'you don\'t have enough capacity for your start items, please make capacity by dropping items.')
            addEvent(itemThinker,10000,cid)
            return true
        end
    end
  return true
end
http://otland.net/f83/oracle-no-island-destiny-81362/#post835683
 
Last edited:
LUA:
local oracleItems = 9011

local firstItems = {
	{ -- sorcerer items
		{id=2457}, -- Steel Helmet
		{id=8819}, -- Magician's robe
		{id=2649}, -- Leather legs
		{id=2643}, -- Leather Boots
		{id=2521}, -- Dark Shield
		{id=2190}, -- Wand of vortex

		{id=2152, count=25}, -- Platinum Coins
		{id=2789, count=100}, -- Brown Mushrooms
	},
	{ -- druid items
		{id=2457}, -- Steel Helmet
		{id=8819}, -- Magician's robe
		{id=2649}, -- Leather Legs
		{id=2643}, -- Leather Boots
		{id=2521}, -- Dark Shield
		{id=2182}, -- Snakebite Rod

		{id=2152, count=25}, -- Platinum Coins
		{id=2789, count=100}, -- Brown Mushrooms
	},
	{ -- paladin items
		{id=2457}, -- Steel Helmet
		{id=2660}, -- Ranger's cloak
		{id=2507}, -- Ranger legs
		{id=2643}, -- Leather Boots
		{id=2521}, -- Dark Shield
		{id=2389, count=10}, -- Spears
		{id=2544, count=100}, -- Arrows
		{id=2456}, -- Bow

		{id=2152, count=25}, -- Platinum Coins
		{id=2789, count=100}, -- Brown Mushrooms
	},
	{ -- knight items
		{id=2457}, -- Steel Helmet
		{id=2463}, -- Plate  Armor
		{id=2647}, -- Plate Legs
		{id=2643}, -- Leather Boots
		{id=2521}, -- Dark Shield
		{id=8602}, -- Jagged Sword
		{id=8601}, -- Steel Axe
		{id=2423}, -- Clerical Mace

		{id=2152, count=25}, -- Platinum Coins
		{id=2789, count=100}, -- Brown Mushrooms
	}
}

function itemThinker(cid)
	if isPlayer(cid) then
		local giveItems = firstItems[getPlayerVocation(cid)]
		if giveItems then
			local backpack = doCreateItemEx(1988)
			for _, v in ipairs(giveItems) do
				doAddContainerItem(backpack, v.id, v.count or 1)
			end
			if doPlayerAddItemEx(cid, backpack, false) == RETURNVALUE_NOERROR then
				setPlayerStorageValue(cid, oracleItems, 1)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You recieved items from the Oracle.')
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough capacity for your start items, please make capacity by dropping items.')
				addEvent(itemThinker, 10000, cid)
			end
		end
	end
end

function onLogin(cid)
	if getPlayerStorageValue(cid, oracleItems) < 1 then
		itemThinker(cid)
	end
	return true
end
 
Back
Top