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

[MOD] Berserk Mode

Collz

Pandas Go RAWR!!!
Joined
Oct 10, 2008
Messages
2,091
Reaction score
57
Location
New York
This script was originally created by Mock. I converted it into a Mod. So all credits goes to the original scripter.

Make a new file in the Mods folder called berserk.xml and add this
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Berserk Mode" version="1.0" author="Collz" contact="none" enabled="yes">
	<talkaction words="!berserk" event="script"><![CDATA[
function choose(...)
   local arg = {...}
   return arg[math.random(1,#arg)]
end
local conf = {
	effectlist = {12,13,14,3,28,29,30,39,68},
	soulPerSec=1,
	soulToStart=25,
	allPercent=50,
}

local combat  = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SUBID, 49)
local cond = {
	CONDITION_PARAM_STAT_MAXHEALTHPERCENT = 31,
	CONDITION_PARAM_STAT_MAXMANAPERCENT = 32,
	CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34,
	CONDITION_PARAM_SKILL_MELEEPERCENT = 35,
	CONDITION_PARAM_SKILL_FISTPERCENT = 36,
	CONDITION_PARAM_SKILL_CLUBPERCENT = 37,
	CONDITION_PARAM_SKILL_SWORDPERCENT = 38,
	CONDITION_PARAM_SKILL_AXEPERCENT = 39,
	CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40,
	CONDITION_PARAM_SKILL_SHIELDPERCENT = 41,
}
for i,b in pairs(cond) do
	setConditionParam(condition, b, 100+conf.allPercent)
end
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)
local function rot(cid,n) --- Script by mock
   local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
   if not isPlayer(cid) or tb_rot[n] == nil or getPlayerSoul(cid) == 0 or getPlayerStorageValue(cid,32481) == -1 then
      return false
   end
   if tb_rot[n] == false then
      doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][1]) , choose(unpack(conf.effectlist)))
      doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][2]) ,choose(unpack(conf.effectlist)))
      addEvent(rot, 200,cid,2)
      return false
   end
   doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][1]) , choose(unpack(conf.effectlist)))
   doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][2]) , choose(unpack(conf.effectlist)))
   n = n+1
   addEvent(rot, 200,cid,n)
end
function checkBuff(cid)
	if not isPlayer(cid) then return end
	if getPlayerSoul(cid) > 0 and getPlayerStorageValue(cid,32481) == 1 then
		doPlayerAddSoul(cid,-conf.soulPerSec)
		doSendMagicEffect(getCreaturePosition(cid) , 49)
		addEvent(checkBuff,1000,cid)
	else
		doRemoveCondition(cid, CONDITION_ATTRIBUTES,49)
		setPlayerStorageValue(cid,32481,-1)
		return false
	end
end
function onSay(cid, words, param, channel) --- Script by mock
	if getPlayerStorageValue(cid,32481) == 1 then
		setPlayerStorageValue(cid,32481,-1)
		doCreatureSay(cid,'BERSERK MODE OFF!',19)
		return true
	end
	if getPlayerSoul(cid) >= conf.soulToStart then
		doPlayerAddSoul(cid,-conf.soulToStart)
		setPlayerStorageValue(cid,32481,1)
		checkBuff(cid)
		rot(cid,1)
		doCreatureSay(cid,'BERSERK MODE ON!',19)
		doCombat(cid, combat, numberToVariant(cid))
	else
		doPlayerSendTextMessage(cid,25,'You need more than 25 soul!')
	end
	return true
end
	]]></talkaction>
</mod>
And your done.

How It Works:
YouTube - Berserk mode by mock

Note:
It uses 1 soul per second!

Original Script
This mod was tested using TFS 0.3.6!
 
Last edited:
Is there a need to transfer it to a mod??..

It is event one file.
 
It saves you the time from having to add one line in your talkactions.xml file :D
Plus I'm bored and have nothing else to do.
 
Code:
author="[B]Collz"[/B]
change to
Code:
author="[B]Mock[/B]


why you only put mod :x
 
I already gave credit to the author, I created the mod so it was created by me :D

I added this tag between xml and mod tags on mine. Satisfactory compromise to include original author credit inside the mod itself.
<!-- Berserk Mode Talkaction by Mock ~~ Mod Conversion by Collz -->
 
yes, more mods mods mods :D
 
Ye actually all releases must be modes. Too much easy as all ppl are lazy now.
 
This works but, when i use it when i have 1 soul point, it lasts forever... >_> Anybody know how to fix this?
 
excuse me for the great bump but i realy need this: "when i turn on berserk mode on i take an special looktype"
 
I already gave credit to the author, I created the mod so it was created by me :D
btw you can do:
XML:
authors="Collz-Mock"
XML:
authors="Collz,Mock"
XML:
authors="Collz;Mock"
XML:
authors="Collz+Mock"
:D :d
 
can someone change the script for me like this rep+ ,

1x !berserk = 30 seconds , and it should remove for each use itemid:12599

thanks
 
This script as talkaction (not mod) and requires item, not soul points. Configurable cooldown and berserk time:
Version to copy (with 'tabs'):
http://paste.ots.me/560792/text

Version to view or when paste.ots.me does not work:
PHP:
local conf = {
effectlist = {12,13,14,3,28,29,30,39,68},
allPercent = 50,
itemId = 12599,
itemName = 'Berserk Stomach',
berserkLength = 30,
berserkCooldown = 120,
storageCooldown = 32485,
storageBerserkTime = 32486
}
-- END OF CONFIG

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, conf.berserkLength * 1000) -- not longer then berserkLength time!
setConditionParam(condition, CONDITION_PARAM_SUBID, 49)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVELPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_FISTPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUBPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORDPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXEPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100 + conf.allPercent)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100 + conf.allPercent)

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatCondition(combat, condition)

function checkBuff(cid, n)
if not isPlayer(cid) then
return
end
local tb_rot = {{0,2},{6,5},{1,3},{7,4}}
local mod = (n % #tb_rot) + 1
if(getPlayerStorageValue(cid, conf.storageBerserkTime) > os.time()) then
if(mod == 1) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
end
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[mod][1]), conf.effectlist[math.random(1,#conf.effectlist)])
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[mod][2]), conf.effectlist[math.random(1,#conf.effectlist)])
addEvent(checkBuff, 200, cid, n+1)
else
doRemoveCondition(cid, CONDITION_ATTRIBUTES, 49)
setPlayerStorageValue(cid, conf.storageBerserkTime, -1)
end
end

function onSay(cid, words, param, channel)
if(getPlayerStorageValue(cid, conf.storageBerserkTime) > os.time()) then
doRemoveCondition(cid, CONDITION_ATTRIBUTES, 49)
setPlayerStorageValue(cid, conf.storageBerserkTime, -1)
doCreatureSay(cid, 'BERSERK MODE OFF!', TALKTYPE_MONSTER)
return true
end
if(getPlayerStorageValue(cid,conf.storageCooldown) < os.time()) then
if(doPlayerRemoveItem(cid, conf.itemId, 1)) then
setPlayerStorageValue(cid, conf.storageCooldown,os.time()+conf.berserkCooldown)
setPlayerStorageValue(cid, conf.storageBerserkTime,os.time()+conf.berserkLength)
checkBuff(cid, 0)
doCreatureSay(cid, 'BERSERK MODE ON!', TALKTYPE_MONSTER)
doCombat(cid, combat, numberToVariant(cid))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Berserk effect stays for 30 seconds. Say !berserk to disable it anytime you want.')
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You need ' .. conf.itemName .. ' to use this buff!')
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wait ' .. (getPlayerStorageValue(cid, conf.storageCooldown) - os.time()) .. ' seconds before you use it again!')
end
return true
end
 
Back
Top