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

onAdvance

Fare

Advanced OT User
Joined
Apr 3, 2008
Messages
2,387
Reaction score
151
Location
Ukraine
anybody can help me? whats wrong?
Here is my first scripts:

data\creaturescripts\scripts\onadvancevoc.lua

PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
	if skill == SKILL__LEVEL and newlevel == 8 then
		local oracleCords = {x=47, y=91, z=13}
		local ppos = getPlayerPosition(cid)
		if getPlayerVocation(cid) == 0 then
			doTeleportThing(cid, oracleCords)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You can now pick a vocation! ")
		end
	end
end

data\creaturescripts\creaturescripts.xml

PHP:
<creaturescripts>
	<event type="login" name="PlayerLogin" script="login.lua"/>
	<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
		<event type="advance" name="onadvancevoc" script="onadvancevoc.lua" />
	</creaturescripts>


data\creaturescripts\scripts\login.lua

PHP:
function onLogin(cid)

	registerCreatureEvent(cid, "PlayerDeath")
	registerCreatureEvent(cid, "onadvancevoc")
	return TRUE
end

When i take level 8, my cpu usage is ~100%, server frezee,all what i can do, reboot computer.

Then I tryed to make other one which create a teleport when somebody takes level8, but is it very stupied, becouse my rook is full of teleports ;\
Can anybody look whats wrong with first script? or maybe say me how can I delete used teleports in second script?
thanks ;D
 
that would be cool if someone fixed it i was searching for it since long time ago.
 
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
	 if skill == SKILL__LEVEL and newlevel == 8 then 
        local oracleCords = {x=47, y=91, z=13} 
        local ppos = getPlayerPosition(cid) 
        if getPlayerVocation(cid) == 0 then 
            doTeleportThing(cid, oracleCords, 0)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You can now pick a vocation! ") 
        end 
    end
end

still server freeze, didn't work for me, can anybody try? I beg all xD anyway Marcinek Paladinek, thanks for always helping xD
 
I havent screwed with new functions yet, are you sure it is SKILL__LEVEL and not SKILL_LEVEL? :p
 
i get this error any ideas?
Code:
[16/05/2008  20:15:31] Error: [CreatureEvent::configureEvent] No valid type for creature event.advance
[16/05/2008  20:15:31] Warning: [BaseEvents::loadFromXml] Can not configure event
 
Well, did you add SKILL__LEVEL and SKILL__MAGLEVEL to global.lua?
You should revise global.lua and check for missing constans.
 
no can u till me what should i do to add it?
 
I already have this in global.lua

SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6

SKILL__MAGLEVEL = 7 --fake 'skill'
SKILL__LEVEL = 8 --fake 'skill'


also, if I use anything other then teleport(like just grats broadcast, or creating portal) it is works =\


@Clary did you have onAdvance? which version you use?
 
Revision 707 - Directory Listing
Modified Wed Apr 23 20:16:40 2008 UTC (3 weeks, 1 day ago) by fightingelf
[Trunk]
* Added onAdvance(cid, skill, oldlevel, newlevel) creature event

onAdvance is added just in trunk revs 707+++
 
Back
Top