and if possible hudimage to use with hudinfo
Forum
CS2D Scripts Tibia script thread (Post tibia requests here)and if possible hudimage to use with hudinfo
CLICK HERE!
READ THE POST! Seriously, read before commenting.
Admin/mod comment
§2.2 - Only meaningful contributions with added valuei mean monster get hurt if u shot him outside monster area with walls
Also to answer your PM, go to the config.lua and edit this table to insert weapon ranges.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
WEAPONRANGE = { -- range of cs2d weapons. e.g. [50] = 27 means wpnid 50 has range of 27 pixels. i should get around to change this to ingame ids some time 		[1] = 350, 		[3] = 350, 		[4] = 350, 		[5] = 350, 		[6] = 350, 		[24] = 350, 		[32] = 350, 		[46] = 128, 		[47] = 128, 		[50] = 32, 		[69] = 32, 		[78] = 32, 	},
Same goes for your PM by the way:
To Tibia or not to Tibia, it's not a question. It's just not a Tibia either.
but on my hud its show speed is 40 but wings dont give speed
and too all wings don't work so please help
Here Example of wing
Also can someone help me how to put cooldown on an infinite rune?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[100] = { 		name = "ember rune", 		desc = "You may use it every x seconds", 		r = 128, g = 0, b = 0, 		action = {"cast","hold"}, 		slot = 9, 		fimage = "gfx/weiwen/rune.png", 		func = {function(id,itemslot,itemid,equip) 			radiusmsg(player(id,"name") .. " casts a fireball rune.", player(id,"x"), player(id,"y")) 			explosion(player(id, "x"), player(id,"y"), 64, 15, id) 			local pos = player(id,"x") .. " " .. player(id,"y") 			parse("effect \"colorsmoke\" " .. pos .. " 100 64 255 128 0;") 			parse("effect \"colorsmoke\" " .. pos .. " 75 64 255 0 0") 			--destroyitem(id, itemslot, equip) 		end,equip}, 	},
VerteX has written
Does anyone know on how to change runes' damage and heal?
Also can someone help me how to put cooldown on an infinite rune?
Also can someone help me how to put cooldown on an infinite rune?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[100] = { 		name = "ember rune", 		desc = "You may use it every x seconds", 		r = 128, g = 0, b = 0, 		action = {"cast","hold"}, 		slot = 9, 		fimage = "gfx/weiwen/rune.png", 		func = {function(id,itemslot,itemid,equip) 			radiusmsg(player(id,"name") .. " casts a fireball rune.", player(id,"x"), player(id,"y")) 			explosion(player(id, "x"), player(id,"y"), 64, 15, id) 			local pos = player(id,"x") .. " " .. player(id,"y") 			parse("effect \"colorsmoke\" " .. pos .. " 100 64 255 128 0;") 			parse("effect \"colorsmoke\" " .. pos .. " 75 64 255 0 0") 			--destroyitem(id, itemslot, equip) 		end,equip}, 	},
Well, look at the function-part of that piece of code. It says
1
explosion(player(id, "x"), player(id,"y"), 64, 15, id)
Which is >this< function in CS2D. So the damage is 15. If you put a negative value (like in the healing rune), you receive lifepoints instead.
And the cooldown stuff, not sure. I think that's not part of default Tibia, is it?
Anyways, I think you can put cooldown on runes using exhaust but can't seem to make it work >_<
KenVo has written
There might be some bugs so tell me if you find any.
config.lua
Add this code to the CONFIG table
functions.lua
1. Under function updateTileItems(x,y), find local heightoffset. Add this code under it:
2. Add this function to functions.lua:
hooks.lua
Find function EXPminute(). Add cleanitems() under it.
config.lua
Add this code to the CONFIG table
1
2
2
--minutes delay until dropped items are automatically remove from the map (except items in houses) 	CLEANITEMSDELAY= 5,
functions.lua
1. Under function updateTileItems(x,y), find local heightoffset. Add this code under it:
1
2
2
local heightoffset = (height < MAXHEIGHT and height or MAXHEIGHT)*3 		item[4] = CONFIG.CLEANITEMSDELAY --this code
2. Add this function to functions.lua:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function cleanitems() 	for k,v in pairs (GROUNDITEMS) do 		local x,y,height 		for a,b in pairs (v) do 			for c,d in pairs (b) do 				d[4] = d[4] -1 				y=k 				x=a 				height=c 				if d[4] <= 0 and not TILEZONE[y][x].HOUSE then 					local item = d 					if item[1] == 1337 then 						if item[2] then freeimage(item[2]) end 						GROUNDITEMS[y][x][height] = nil 					else 						local tile = gettile(x*32, y*32) 						if tile.HEAL and ITEMS[item[1]].heal then 							tile.HEAL = tile.HEAL - ITEMS[item[1]].heal 							if tile.HEAL == 0 then 								tile.HEAL = nil 							end 						end 						if item[2] then freeimage(item[2]) end 						GROUNDITEMS[y][x][height] = nil 					end 				end 			end 		end 	end 	 end
hooks.lua
Find function EXPminute(). Add cleanitems() under it.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("minute","EXPminute") function EXPminute() 	cleanitems() 	MINUTES = MINUTES+1 	if game'sv_password' == '' and MINUTES%5 == 0 then 		saveserver() 	end end
This doesn't work IDK if I did something wrong
1
2
3
4
2
3
4
LUA ERROR: sys/lua/cs2dtibia/functions.lua:345: attempt to index field '?' (a nil value) -> sys/lua/cs2dtibia/functions.lua:345: in function 'gettile' -> sys/lua/cs2dtibia/functions.lua:683: in function 'cleanitems' -> sys/lua/cs2dtibia/hooks.lua:242: in function <sys/lua/cs2dtibia/hooks.lua:241>
(for new people this is meant to despawn items after ? minutes)
I had to wait 5 minutes for the cooldown ( it felt a lot longer than 5 minutes )
(Hint: Scroll down)
TrialAndError has written
Thanks it worked
Now I need the same thing (I think) for monsters
For example every monster will despawn every 1 hour
1
2
3
2
3
for _, m in ipairs(MONSTERS) do 	m.destroy(m) end