ivvanek
New Member
- Joined
- Mar 24, 2009
- Messages
- 113
- Reaction score
- 3
Hello,
I am stuck at 2 mission when you have to fill up the horn from the bucket.
In the map editor i have set on the bucket
mead.lua:
horn.lua
Which actionid i have to put in the editor on the bear and on the mamooth if i have this script? (please look at my actions.xml)
Do not understand that range.
I am stuck at 2 mission when you have to fill up the horn from the bucket.
In the map editor i have set on the bucket
actionid=3110
because of the first mission i have actionid=3110:
XML:
<!-- Barbarian Test Quest -->
<action fromid="7174" toid="7176" script="quests/barbarian test/horn.lua" />
<action fromid="7140" toid="7141" script="quests/barbarian test/horn.lua" />
<action actionid="3110" script="quests/barbarian test/mead.lua" />
mead.lua:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(Storage.BarbarianTest.Questline) == 2 and player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) <= 20 then
if math.random(5) > 1 then
player:say('The world seems to spin but you manage to stay on your feet.', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.MeadSuccessSips, player:getStorageValue(Storage.BarbarianTest.MeadSuccessSips) + 1)
if player:getStorageValue(Storage.BarbarianTest.MeadSuccessSips) == 9 then -- 9 sips here cause local player at start
player:say('10 sips in a row. Yeah!', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.Questline, 3)
player:setStorageValue(Storage.BarbarianTest.Mission01, 3) -- Questlog Barbarian Test Quest Barbarian Test 1: Barbarian Booze
return true
end
else
player:say('The mead was too strong. You passed out for a moment.', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.MeadSuccessSips, 0)
end
player:setStorageValue(Storage.BarbarianTest.MeadTotalSips, player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) + 1)
elseif player:getStorageValue(Storage.BarbarianTest.MeadTotalSips) > 20 then
player:say('Ask Sven for another round.', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.Questline, 1)
player:setStorageValue(Storage.BarbarianTest.Mission01, 1) -- Questlog Barbarian Test Quest Barbarian Test 1: Barbarian Booze
elseif player:getStorageValue(Storage.BarbarianTest.Questline) >= 3 then
player:say('You already passed the test, no need to torture yourself anymore.', TALKTYPE_MONSTER_SAY)
end
return true
end
horn.lua
Lua:
local function sendSleepEffect(position)
position:sendMagicEffect(CONST_ME_SLEEP)
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.uid == 3110 and item.itemid == 7140 then
player:say('You fill your horn with ale.', TALKTYPE_MONSTER_SAY)
item:transform(7141)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif target.itemid == 7174 and item.itemid == 7141 then
player:say('The bear is now unconcious.', TALKTYPE_MONSTER_SAY)
item:transform(7140)
target:transform(7175)
toPosition:sendMagicEffect(CONST_ME_STUN)
elseif item.itemid == 7175 then
if player:getStorageValue(Storage.BarbarianTest.Questline) == 4 then
player:say('You hug the unconcious bear.', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.Questline, 5)
player:setStorageValue(Storage.BarbarianTest.Mission02, 2) -- Questlog Barbarian Test Quest Barbarian Test 2: The Bear Hugging
player:addAchievement('Bearhugger')
item:transform(7174)
toPosition:sendMagicEffect(CONST_ME_SLEEP)
else
player:say('You don\'t feel like hugging an unconcious bear.', TALKTYPE_MONSTER_SAY)
end
elseif item.itemid == 7174 then
player:say('Grr.', TALKTYPE_MONSTER_SAY)
player:say('The bear is not amused by the disturbance.', TALKTYPE_MONSTER_SAY)
doAreaCombatHealth(player, COMBAT_PHYSICALDAMAGE, player:getPosition(), 0, -10, -30, CONST_ME_POFF)
elseif item.itemid == 7176 then
if player:getStorageValue(Storage.BarbarianTest.Questline) == 6 then
if player:getCondition(CONDITION_DRUNK) then
player:say('You hustle the mammoth. What a fun. *hicks*.', TALKTYPE_MONSTER_SAY)
player:setStorageValue(Storage.BarbarianTest.Questline, 7)
player:setStorageValue(Storage.BarbarianTest.Mission03, 2) -- Questlog Barbarian Test Quest Barbarian Test 3: The Mammoth Pushing
item:transform(7177)
item:decay()
addEvent(sendSleepEffect, 60 * 1000, toPosition)
toPosition:sendMagicEffect(CONST_ME_SLEEP)
else
player:say('You are not drunk enought to hustle a mammoth.', TALKTYPE_MONSTER_SAY)
end
end
end
return true
end
Which actionid i have to put in the editor on the bear and on the mamooth if i have this script? (please look at my actions.xml)
XML:
<action fromid="7174" toid="7176" script="quests/barbarian test/horn.lua" />
<action fromid="7140" toid="7141" script="quests/barbarian test/horn.lua" />
Last edited: