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

Spider webs don't break & spider eggs don't break

jclay

Member
Joined
Dec 18, 2011
Messages
109
Reaction score
6
To make it short: I was creating a wall of spider webs to put a giant spider behind it, so that you can break the spider web to allow it to attack you. But when I tried to use a weapon on it, it can't. It doesn't even "poff" on it.

Is there a way to implement this? I'm using the server Printer posted on here, so its 1.0

Also, spider eggs are supposed to break and have a chance of spawning a spider or taranutla but they don't(this isn't as much of a big deal)
 
I'm not entirely sure.. but I think it's located in a weapons file located in actions/others/destroy.lua.
This is what I know of TFS at least. (assuming you were using that).

It will have a function you need to confirm you have first, saying this:
PHP:
destroyItem(cid, itemEx, toPosition)

if this is true, you find the full function at actions/lib/actions.lua
in there you'll see all kind of item-ids of weapons and things they will do when you use weapons on certain things.
edit: maybe you don't have weapons id in there but you'll always have the item_ids of the item you're using the weapon on.

from there you can just add in the code something like:
PHP:
elseif itemEx.itemid == WEB_ID or itemEx.itemid == ANOTHER_WEB_ID then
               doTransformItem(itemEx.uid, BROKEN_WEB)
            end

and in that you can add another code saying etc
PHP:
chance = math.random(0,100)
if chance <= 10 then
      doSummonCreature("Tarantula", getPlayerPosition(cid))
end

This isn't much help but I hope it's enough to give you some ideas what to do =)
 
Here you are, you do however only right click on it:

actions.xml
Code:
 <action itemid="7537" script="SpiderEgg.lua" />
 <action itemid="7585" script="SpiderEgg.lua" />

SpiderEgg.lua
Code:
function onUse(cid, item, frompos, item2, topos)
 recentID = item.itemid
 local function closeegg()
 doTransformItem(getThingfromPos(frompos).uid, recentID)
 return true
 end
 local rand, effect = math.random(1, 100), CONST_ME_TELEPORT
 if((rand >= 50) and (rand < 83)) then
 doSummonCreature("Spider", frompos)
 elseif((rand >= 83) and (rand < 97)) then
 doSummonCreature("Poison Spider", frompos)
 elseif((rand >= 97) and (rand < 100)) then
 doSummonCreature("Tarantula", frompos)
 elseif(rand == 100) then
 doSummonCreature("Giant Spider", frompos)
 else
 effect = CONST_ME_POFF
 end
 doTransformItem(item.uid, 7566)
 doSendMagicEffect(frompos, effect)
 addEvent(closeegg, 2700000)
 return true
end

Kind Regards,
Eldin.
 
Here you are, you do however only right click on it:

actions.xml
Code:
<action itemid="7537" script="SpiderEgg.lua" />
<action itemid="7585" script="SpiderEgg.lua" />

SpiderEgg.lua
Code:
function onUse(cid, item, frompos, item2, topos)
recentID = item.itemid
local function closeegg()
doTransformItem(getThingfromPos(frompos).uid, recentID)
return true
end
local rand, effect = math.random(1, 100), CONST_ME_TELEPORT
if((rand >= 50) and (rand < 83)) then
doSummonCreature("Spider", frompos)
elseif((rand >= 83) and (rand < 97)) then
doSummonCreature("Poison Spider", frompos)
elseif((rand >= 97) and (rand < 100)) then
doSummonCreature("Tarantula", frompos)
elseif(rand == 100) then
doSummonCreature("Giant Spider", frompos)
else
effect = CONST_ME_POFF
end
doTransformItem(item.uid, 7566)
doSendMagicEffect(frompos, effect)
addEvent(closeegg, 2700000)
return true
end

Kind Regards,
Eldin.


This worked, thanks alot.
 
Here you are, you do however only right click on it:

actions.xml
Code:
<action itemid="7537" script="SpiderEgg.lua" />
<action itemid="7585" script="SpiderEgg.lua" />

SpiderEgg.lua
Code:
function onUse(cid, item, frompos, item2, topos)
recentID = item.itemid
local function closeegg()
doTransformItem(getThingfromPos(frompos).uid, recentID)
return true
end
local rand, effect = math.random(1, 100), CONST_ME_TELEPORT
if((rand >= 50) and (rand < 83)) then
doSummonCreature("Spider", frompos)
elseif((rand >= 83) and (rand < 97)) then
doSummonCreature("Poison Spider", frompos)
elseif((rand >= 97) and (rand < 100)) then
doSummonCreature("Tarantula", frompos)
elseif(rand == 100) then
doSummonCreature("Giant Spider", frompos)
else
effect = CONST_ME_POFF
end
doTransformItem(item.uid, 7566)
doSendMagicEffect(frompos, effect)
addEvent(closeegg, 2700000)
return true
end

Kind Regards,
Eldin.

You rock, Eldin :)
 
Back
Top