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

Vocations , Magic Effects.

Blackchris95

New Member
Joined
Apr 6, 2010
Messages
152
Reaction score
0
Hello Otlander,

I have created many new Vocations
How can add to the Vocations Magical Effect?

Vocations:

609-624

Can anybody write a script.
 
Last edited:
What do you mean? Magic effects like 'poof' when vocation moves? If so, then there is such script on forum, can't find it now.
 
which the Vocation every second makes a Magic Effect.

With me is a Magic effect, the number is 15, the yellow flashes

For me the Vocation 75 Blue flashes I have now made ​​a new Vocation (622) which should then make yellow flashes

So the "Transform" (Vocation) If every second of the Magic play effect

______________

i use Translator sorry for bad english
 
Here's script I made, dunno if that will work. Configuration is pretty self explaining, just fill proper vocation ids and effects.

globalevents/scripts/magic-effect.lua
Code:
local effects = {
	-- vocation => effect
	[1] = 15,
	[2] = 15,
	[3] = 15,
	[4] = 15
}

function onThink(interval)
	for _, pid in ipairs(getPlayersOnline()) do
		local effect = effects[getPlayerVocation(pid)]
		if(effect) then
			doSendMagicEffect(getCreaturePos(pid), effect)
		end
	end

	return true
end

Thats a global event, don't forget to put this line into globalevents.xml:
Code:
<globalevent name="magic-effect" interval="1" event="script" value="magic-effect.lua"/>

About translator: no problem, I understood most things. Those tools are very accurate last times.
 
Last edited:
Here's script I made, dunno if that will work. Configuration is pretty self explaining, just fill proper vocation ids and effects.

creaturescripts/scripts/magic-effect.lua
Code:
local effects = {
	-- vocation => effect
	[1] [b]=>[/b] 15,
	[2] [b]=>[/b] 15,
	[3] [b]=>[/b] 15,
	[4] [b]=>[/b] 15
}

function onThink(interval)
	for _, pid in ipairs(getPlayersOnline()) do
		local effect = effects[getPlayerVocation(cid)]
		if(effect) then
			doSendMagicEffect(getCreaturePos(pid), effect)
		end
	end

	return true
end

Thats a global event, don't forget to put this line into globalevents.xml:
Code:
<globalevent name="magic-effect" interval="1" event="script" value="magic-effect.lua"/>

About translator: no problem, I understood most things. Those tools are very accurate last times.
>=>
should be "=" :p
 
i dont have the Data : Magic-Effect.lua and globalevent.xml

i have only this folders :
6jmutiumbpij.png

and
mjwbje4obi89.png


I have a Older Forgotten Server its a Dragonball OTS ^^ .....

Can you help me about Teamviewer ? or anybody :S
 
>=>
should be "=" :p

yay, too much php last times in my mind, thanks : p

i dont have the Data : Magic-Effect.lua and globalevent.xml

i have only this folders :
6jmutiumbpij.png

and
mjwbje4obi89.png


I have a Older Forgotten Server its a Dragonball OTS ^^ .....

Can you help me about Teamviewer ? or anybody :S

Can't see anything from your images. if you don't have global events, then you can try to make it in creature scripts (also onThink event), that would be even easier.

@edit
okay seems you edited your post, now I can see it.

Lets try this creature event then:
(create new file called magic-effect.lua in creaturescripts/scripts directory)
Code:
local effects = {
	-- vocation => effect
	[1] = 15,
	[2] = 15,
	[3] = 15,
	[4] = 15
}

function onThink(cid, interval)
	local effect = effects[getPlayerVocation(cid)]
	if(effect) then
		doSendMagicEffect(getCreaturePos(cid), effect)
	end

	return true
end

creaturescripts.xml:
Code:
<event type="think" name="magic-effect" event="script" value="magic-effect.lua"/>

Last thing to do is, adding this line at the end of login.lua file:
Code:
registerCreatureEvent(cid, "magic-effect")
 
ok I test if it works you're the greatest

MY Scirpts All Right ?

Login.lua :

function onLogin(cid)
registerCreatureEvent(cid, "expRate")
registerCreatureEvent(cid, "magic-effect")

return 1
end

Creaturscripts.lua :
<?xml version="1.0"?>

<creaturescripts>
<event type="think" name="magic-effect" event="script" value="magic-effect.lua"/>



</creaturescripts>

Magic-effects :

local effects = {
-- vocation => effect
[621] = 15,
[622] = 15,
[623] = 15,
[624] = 15
}

function onThink(interval)
for _, pid in ipairs(getPlayersOnline()) do
local effect = effects[getPlayerVocation(cid)]
if(effect) then
doSendMagicEffect(getCreaturePos(pid), effect)
end
end

return true
end

its the Login.lua and Creaturescript.lua right?
 
Last edited:
doesent Work !!!!

look here :

qu85hafxf5h5.png


Bubas and Goki have Magic Effects per Second !!!!

and my name is Super'Goten i have Vocation 622 and no Magic effects ?????
 
Last edited:
doesent Work !!!!

look here :

qu85hafxf5h5.png


Bubas and Goki have Magic Effects per Second !!!!

and my name is Super'Goten i have Vocation 622 and no Magic effects ?????

Something wrong configured then, check if your vocation id is really 622 in vocations.xml and also if it fits with "vocations" in script.
 
Here is the vocations.xml

<vocation id="622" name="Gotenks xReborn" description="a xReborn Gotenks" gaincap="50" gainhp="280" gainmana="250" gainhpticks="6" gainhpamount="400" gainmanaticks="3" gainmanaamount="400" manamultiplier="1.1" attackspeed="31" soulmax="200" gainsoulticks="120" lostexp="3" lostmlv="3" lostskill="3" distdamage="100" meledamage="600" kidamage="17" corpse="2972" charge="17">
<skill id="0" multiplier="3.0"/>
<skill id="1" multiplier="3.0"/>
<skill id="2" multiplier="3.0"/>
<skill id="3" multiplier="1.1"/>
<skill id="4" multiplier="1.1"/>
<skill id="5" multiplier="1.1"/>
<skill id="6" multiplier="1.1"/>
</vocation>

its 622 !!!

if it fits with "vocations" in script

Vocations in Script where is it ???
 
Last edited:
I mean this

Code:
local effects = {
-- vocation => effect
[621] = 15,
[622] = 15,
[623] = 15,
[624] = 15
}

Anyway, try this one and tell me what it says in console:
Code:
local effects = {
	-- vocation => effect
	[621] = 15,
	[622] = 15,
	[623] = 15,
	[624] = 15
}

function onThink(interval)
	for _, pid in ipairs(getPlayersOnline()) do
		local effect = effects[getPlayerVocation(cid)]
		if(effect) then
			doSendMagicEffect(getCreaturePos(pid), effect)
		else
			print('Slaw: Cannot find effect for vocation: ' . getPlayerVocation(cid))
		end
	end

	return true
end
 
The console shows no errors

But what I found out

Console :

Loading Config.lua
loading Bans
Loading data/Vocations.xml
Loading data/commands.xml
Loading data/item/items.otb
Loading data/item/items.xml
Loading Scrypt System
Loading Weapons
Loading Spells
Loading Actions
Loading Talkaktions
Loading Move Events
Loading Creature Events
Loading Monster
etc...

But she Doesent Load creaturescript.xml

its Normal?
 
eh other vocations has this Magic Effects!!!!. but i dont has this make !!!

-.-"

where else could stand in it?

Here Scripts !!

Creaturscripts.xml

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>

</creaturescripts>

login.lua

function onLogin(cid)
registerCreatureEvent(cid, "magic-effect")


return TRUE
end

magice-effect.lua

local effects = {
-- vocation => effect
[621] = 15,
[614] = 15,
[612] = 15,
[622] = 15
}

function onThink(interval)
for _, pid in ipairs(getPlayersOnline()) do
local effect = effects[getPlayerVocation(cid)]
if(effect) then
doSendMagicEffect(getCreaturePos(pid), effect)
else
print('Slaw: Cannot find effect for vocation: ' . getPlayerVocation(cid))
end
end

return true
end
 
Last edited:
Back
Top