Exmortis
Member
- Joined
- Jun 27, 2008
- Messages
- 189
- Reaction score
- 5
As the title says, I need exhaust for the following scripts to avoid alot of memory usage if players would abuse the scripts for crashing the server or such.
If you can make it easy configurable so I can choose the exhaust myself that would be swell.
Or if you could tell me how to add it effectively to any script in the future.
Rep+
First script, teleportscroll:
Second script, outfit doll:
Third script, toilettes:
Fourth script, showers:
If you can make it easy configurable so I can choose the exhaust myself that would be swell.
Or if you could tell me how to add it effectively to any script in the future.
Rep+
First script, teleportscroll:
Code:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Warped!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return 1
end
Second script, outfit doll:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v, tmp = math.random(351), getCreatureOutfit(cid)
while isInArray({tmp.lookType, 75, 135, 266, 302}, v) == TRUE or v <= 1 or (v > 160 and v < 192) or v > 351 do
v = math.random(351)
end
tmp.lookType = v
doCreatureChangeOutfit(cid, tmp)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSay(cid, 'Your outfit has been changed.', TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
return TRUE
end
Third script, toilettes:
Code:
local message = "You took a dump and you feel alot lighter"
local speed = 450 --- Put the speed you'd like
local time = 200 --- Put the time you'd like (it will be multiplied by 1000)
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
doSendMagicEffect(ppos,65)
doPlayerAddMana(cid, 500)
doChangeSpeed(cid, speed)
addEvent(doChangeSpeed, time*1000, cid, -speed)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,message) ---- If you don't want messages displayed then erase this line
return true
end
Fourth script, showers:
Code:
local gratePos = {x=1004, y=1137, z=9}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getTileItemById(gratePos, 9586).uid
if v == 0 then
local p = getTopCreature(gratePos).uid
if p ~= cid then
doPlayerSendCancel(cid, 'You need to stand on the grate.')
else
doCreateItem(9586, 1, gratePos)
doSendMagicEffect(gratePos, CONST_ME_WATERSPLASH)
doCreatureSay(cid, 'Ohh, that felt so good!', TALKTYPE_ORANGE_1)
doCreatureAddHealth(cid, 10)
end
else
doRemoveItem(v)
end
return true
end