• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action & [TalkAction] Minigame EVENT

supomglol

Member
Joined
Jan 29, 2012
Messages
195
Reaction score
10
How it works!
Players are sent to a central location, behind a maze of monsters, that are immune to EVERYTHING but drowning damage. Where they are given a special rune, that does drowning damage! (always the same amount, of 3 damage per .5 seconds for 1.5 seconds) Monsters are somewhat low hp (between 10 and 200). First one to make it through the monsters gets a reward and is sent home! The rest of the players must finish the event before they are sent home. They will get a reward too, for participating.
in TALKACTIONS -> Scripts-> MGjoin.lua
Lua:
local startstorage = 87381
local amountofplayers = 87382
local playing = 87383
local winner = 87384 
local over = 87385

function onSay(cid, words, param)
if getGlobalStorageValue(startstorage) == 1  then
if getGlobalStorageValue(amountofplayers) < 5 then
		doBroadcastMessage("A player has joined the minigame event!", MESSAGE_STATUS_WARNING)	
		doTeleportThing(cid, {x = 2021, y = 2028, z = 7})
		setGlobalStorageValue(amountofplayers, getGlobalStorageValue(amountofplayers)+1)
			setPlayerStorageValue(cid, playing, 1)
			end
elseif 	getGlobalStorageValue(startstorage) == 0  then	
doPlayerPopupFYI(cid,"The game is currently not recruiting anyone.")	
			end
			end
in ACTIONS->Scripts-> mg.lua
Code:
local startstorage = 87381
local amountofplayers = 87382
local playing = 87383
local winner = 87384 
local over = 87385
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 8413 and
		getGlobalStorageValue(over) == 0 then
		doPlayerAddItem(cid,9971, 4)
		setGlobalStorageValue(startstorage, 0)
		setGlobalStorageValue(amountofplayers, 0)
		setGlobalStorageValue(over, 1)
		doBroadcastMessage("The minigame is over! We have our winner!", MESSAGE_STATUS_WARNING)	
		doTeleportThing(cid, {x = 32369, y = 32241, z = 7})	
		doPlayerPopupFYI(cid,"You have won!")
	setPlayerStorageValue(cid, playing, 0)		
		elseif getGlobalStorageValue(over) == 1 then
		doTeleportThing(cid, {x = 32369, y = 32241, z = 7})
		doPlayerAddItem(cid,9971, 1)
		doPlayerPopupFYI(cid, "Thank for playing! But you did not win. You get 1 token for your efforts.")
		setPlayerStorageValue(cid, playing, 0)


end
end

In actions->scripts->mg2.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 8414 then
	doPlayerAddItem(cid,2267,50)
	return true
	end

end

In spells->scripts->Attack->mgrune.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_Drowning)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

local condition = createConditionObject(CONDITION_DROWN)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 3, 500, -3)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

In spells.xml

Code:
	<rune name="Minigame Rune" id="2267" allowfaruse="1" charges="50" lvl="8" maglv="3" exhaustion="1000" needtarget="1" blocktype="solid" event="script" value="attack/mgrune.lua"/>

In Talkactions->scripts->StartMG.lua
Code:
local startstorage = 87381
local over = 87385

function onSay(cid, words, param)
if getGlobalStorageValue(startstorage) ~= 1  then 
setGlobalStorageValue(startstorage, 1)
setGlobalStorageValue(over, 0)
doBroadcastMessage("Our minigame event is now 5 recruiting players! Type !mgjoin to sign up.", 22)
	return true
elseif getGlobalStorageValue(startstorage) == 1 then
doPlayerPopupFYI(cid, "The event has been cancelled, and is ready to restart.")
setGlobalStorageValue(over, 0)
return true

end
end

In talkactions.xml
Code:
	<talkaction log="yes" words="/mgstart" access="4" event="script" value="startmg.lua"/>
	<talkaction log="yes" words="!mgjoin" event="script" value="mgjoin.lua"/>

In Actions.xml
Code:
<action uniqueid="8413" event="script" value="mg.lua"/>
<action uniqueid="8414" event="script" value="mg2.lua"/>

In Monsters.xml
Code:
<monster name="mg1" file="minigame/mg1.xml"/>
<monster name="mg2" file="minigame/mg2.xml"/>
<monster name="mg3" file="minigame/mg3.xml"/>
<monster name="mg4" file="minigame/mg4.xml"/>
<monster name="mg5" file="minigame/mg5.xml"/>
<monster name="mg6" file="minigame/mg6.xml"/>

In Monsters/minigame/mg1.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg1" nameDescription="a rat" race="blood" experience="5" speed="0" manacost="200">
  <health now="20" max="20"/>
  <look type="21" head="20" body="30" legs="40" feet="50" corpse="5964"/>
  <targetchange interval="2000" chance="0"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>

  <defenses armor="1" defense="2"/>

  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
  <voices interval="5000" chance="10">
	<voice sentence="Meep!"/>
  </voices>
  <loot>
    <item id="3976" countmax="10" chance1="50000" chancemax="0"/>
    <item id="2148" countmax="7" chance1="80000" chancemax="0"/>
    <item id="2696" chance="20000"/>
  </loot>
  
</monster>

Same, but mg2
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg2" nameDescription="a dog" race="blood" experience="0" speed="0" manacost="220">
	<health now="40" max="40"/>
	<look type="32" corpse="5971"/>
	<targetchange interval="2000" chance="0"/>
	<strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>
	<defenses armor="1" defense="2"/>

  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
	

	<voices interval="5000" chance="10">
		<voice sentence="Wuff! Wuff!"/>
	</voices>
</monster>

mg3

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg3" nameDescription="a wolf" race="blood" experience="18" speed="0" manacost="255">
	<health now="60" max="60"/>
	<look type="27" corpse="5968"/>
	<targetchange interval="2000" chance="0"/>
	<strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>

	<defenses armor="1" defense="4"/>

	  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
	<loot>
		<item id="2666" countmax="2" chance="25000"/><!-- meat -->
		<item id="3976" chance="9000"/><!-- worm -->
		<item id="5897" chance="1500"/><!-- wolf paw -->
	</loot>
	
</monster>

mg4
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg4" nameDescription="a war wolf" race="blood" experience="55" speed="0" manacost="0">
	<health now="100" max="100"/>
	<look type="3" corpse="6009"/>
	<targetchange interval="2000" chance="0"/>
	<strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>

	<defenses armor="10" defense="16"/>

	<voices interval="5000" chance="10">
		<voice sentence="Grrrrrrr"/>
		<voice sentence="Yoooohhuuuu!" yell="1"/>
	</voices>
  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
	<loot>
		<item id="2666" countmax="4" chance="25000"/><!-- meat -->
		<item id="2671" countmax="2" chance="20000"/><!-- ham -->
		<item id="11229" chance="9000"/><!-- wolf paw -->
		<item id="5897" chance="2000"/><!-- wolf paw -->
		<item id="3976" chance="500"/><!-- wolf trophy -->
	</loot>
	
</monster>

mg5
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg5" nameDescription="a hellhound" race="blood" experience="6800" speed="0" manacost="0">
	<health now="150" max="150"/>
	<look type="240" corpse="6332"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>
	<defenses armor="25" defense="35"/>

  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
	<voices interval="5000" chance="10">
		<voice sentence="GROOOWL!"/>
		<voice sentence="GRRRRR!"/>
	</voices>
	<loot>
		<item id="2148" countmax="100" chance="25000"/><!-- gold coin -->
		<item id="2148" countmax="100" chance="25000"/><!-- gold coin -->
		<item id="2148" countmax="100" chance="25000"/><!-- gold coin -->
		<item id="2148" countmax="75" chance="25000"/><!-- gold coin -->
		<item id="2152" countmax="5" chance="5000"/><!-- platinum coin -->
		<item id="2671" countmax="6" chance="22500"/><!-- ham -->
		<item id="2410" countmax="11" chance="9000"/><!-- throwing knife -->
		<item id="2144" countmax="4" chance="7000"/><!-- black pearl -->
		<item id="2231" chance="30000"/><!-- big bone -->
		<item id="10553" chance="9000"/><!-- big bone -->
		<item id="2230" chance="25000"/><!-- bone -->
		<item id="6558" chance="6500"/><!-- concentrated demonic blood -->
		<item id="6500" chance="15000"/><!-- demonic essence -->
		<item id="2148" chance="3500"/><!-- gold ingot -->
		<item id="1987" chance="100000"><!-- bag -->
			<inside>
				<item id="9808" chance="2000"/><!-- rusty armor -->
				<item id="2393" chance="3000"/><!-- giant sword -->
				<item id="5944" chance="7500"/><!-- soul orb -->
				<item id="2430" chance="5000"/><!-- knight axe -->
				<item id="2383" chance="4000"/><!-- spike sword -->
				<item id="6553" chance="800"/><!-- ruthless axe -->
			</inside>
		</item>
	</loot>
	
	
</monster>

mg6

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="mg6" nameDescription="a juggernaut" race="blood" experience="8700" speed="0" manacost="0">
	<health now="200" max="200"/>
	<look type="244" corpse="6336"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="5"/>
  </flags>
	

  	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity ice="1"/>
		<immunity death="1"/>
		<immunity holy="1"/>	
	</immunities>
	<voices interval="5000" chance="30">
		<voice sentence="WAHHHH!" yell="1"/>
		<voice sentence="RAAARRR!" yell="1"/>
		<voice sentence="GRRRRRR!" yell="1"/>
	</voices>
	<loot>
    <item id="2671" chance="83025" /><!-- ham -->
    <item id="2148" countmax="100" chance="40375" /><!-- gold coin -->
    <item id="2148" countmax="89" chance="40375" /><!-- gold coin -->
    <item id="6558" countmax="4" chance="20500" /><!-- concentrated demonic blood -->
    <item id="5944" chance="34900" /><!-- soul orb -->
    <item id="7590" chance="10350" /><!-- great mana potion -->
    <item id="6500" chance="45400" /><!-- demonic essence -->
    <item id="9808" chance="9500" /><!-- rusty armor -->
    <item id="7365" countmax="5" chance="1475" /><!-- onyx arrow -->
    <item id="7591" chance="9800" /><!-- great health potion -->
    <item id="2152" countmax="4" chance="4625" /><!-- platinum coin -->
    <item id="1987" chance="100000"><!-- bag -->
        <inside>
            <item id="2153" chance="4675" /><!-- gold ingot -->
            <item id="7368" countmax="2" chance="1175" /><!-- assassin star -->
            <item id="2514" chance="775" /><!-- mastermind shield -->
            <item id="2452" chance="625" /><!-- heavy mace -->
            <item id="7452" chance="2375" /><!-- spiked squelcher -->
            <item id="2136" chance="900" /><!-- demonbone amulet -->
            <item id="2578" chance="625" /><!-- closed trap -->
        </inside>
    </item>
</loot>


















</monster>

exmap.jpg

View attachment mgmap.rar


Here is my pic, and here is my map.


Enjoy everyone!



+REP If you used!!!!!!
 
Last edited:
Thanks for the positive comments guys! I re-did some coding today (i had found a small bug)

I also made a debug talkaction (it resets all player storage values and globla storage values involved with this script) if anyone is interested, i will post it here!:D
 
The map is there and attached!

- - - Updated - - -

its the 'mgmap.rar' below the picture of the map
 
my bad !!!
Code:
local startstorage = 87381
local amountofplayers = 87382
local playing = 87383
local winner = 87384 
local over = 87385

function onSay(cid, words, param)
if getGlobalStorageValue(startstorage) == 1  then
if getGlobalStorageValue(amountofplayers) < 5 then
		doBroadcastMessage("A player has joined the minigame event!", MESSAGE_STATUS_WARNING)	
		doTeleportThing(cid, {x = 2021, y = 2028, z = 7})
		setGlobalStorageValue(amountofplayers, getGlobalStorageValue(amountofplayers)+1)
			setPlayerStorageValue(cid, playing, 1)
			end
elseif 	getGlobalStorageValue(startstorage) == 0  then	
doPlayerPopupFYI(cid,"The game is currently not recruiting anyone.")	
			end
			end

- - - Updated - - -

This is the MGJOIN Talkaction
 
Back
Top