-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My last work #213
base: master
Are you sure you want to change the base?
My last work #213
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
local elevatorPosition = { | ||
Position(33638, 31903, 5), | ||
Position(33638, 31903, 6) | ||
} | ||
|
||
local config = { | ||
[1] = { | ||
fromPosition = elevatorPosition[1], | ||
toPosition = elevatorPosition[2], | ||
itemIds = { 23432, 23421 }, | ||
transform = { | ||
position = { elevatorPosition[1], elevatorPosition[2] }, | ||
itemId = { 23421, 23421 }, | ||
transformId = { 23424, 23428 } | ||
}, | ||
sound = 'Srrrt!', | ||
soundPosition = Position(33639, 31903, 5), | ||
relocatePosition = Position(33638, 31902, 5) | ||
}, | ||
[2] = { | ||
fromPosition = elevatorPosition[2], | ||
toPosition = elevatorPosition[1], | ||
itemIds = { 23432, 23428 }, | ||
transform = { | ||
position = { elevatorPosition[1], elevatorPosition[1] }, | ||
itemId = { 23424, 23428 }, | ||
transformId = { 23421, 23421 }, | ||
}, | ||
sound = 'Zrrrt!', | ||
soundPosition = Position(33639, 31903, 6), | ||
relocatePosition = Position(33638, 31904, 6) | ||
} | ||
} | ||
|
||
local winch = { | ||
[23422] = { config[2], config[1] }, | ||
[23429] = { config[1], config[2] } | ||
} | ||
|
||
local relocate = true | ||
|
||
local function moveElevator(config, player) | ||
for i = 1, #config.itemIds do | ||
local item = Tile(config.fromPosition):getItemById(config.itemIds[i]) | ||
if item then | ||
item:moveTo(config.toPosition) | ||
end | ||
end | ||
|
||
for i = 1, #config.transform.position do | ||
local item = Tile(config.transform.position[i]):getItemById(config.transform.itemId[i]) | ||
if item then | ||
item:transform(config.transform.transformId[i]) | ||
end | ||
end | ||
|
||
if player then | ||
player:say(config.sound, TALKTYPE_MONSTER_YELL, false, player, config.soundPosition) | ||
end | ||
end | ||
|
||
function onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
local useItem = winch[item.itemid] | ||
if not useItem then | ||
return true | ||
end | ||
|
||
toPosition.x = toPosition.x - 1 | ||
local tile = Tile(toPosition) | ||
if not tile:getItemById(23432) then | ||
local option = useItem[1] | ||
if relocate then | ||
Tile(option.fromPosition):relocateTo(option.relocatePosition) | ||
end | ||
|
||
moveElevator(option, player) | ||
return true | ||
end | ||
|
||
local creature = tile:getTopCreature() | ||
if not creature or creature.uid ~= player.uid then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Step inside the elevator to use it.') | ||
return true | ||
end | ||
|
||
local option = useItem[2] | ||
moveElevator(option, player) | ||
player:teleportTo(option.toPosition) | ||
return true | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
local function revertRoot(position, itemId, transformId) | ||
local item = Tile(position):getItemById(itemId) | ||
if item then | ||
item:transform(transformId) | ||
end | ||
end | ||
|
||
function onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
local harvestedCount = player:getStorageValue(Storage.Oramond.HarvestedRootCount) | ||
local rand = math.random(1, 100) | ||
if item.itemid == 23475 then | ||
if((rand >= 1) and (rand < 50)) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You successfully harvest some juicy roots.') | ||
player:addItem(23662, 1) | ||
item:transform(item.itemid + 2) | ||
addEvent(revertRoot, 300000, toPosition, 23477, 23475) | ||
toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) | ||
if player:getStorageValue(Storage.Oramond.MissionToTakeRoots) < 0 then | ||
player:setStorageValue(Storage.Oramond.HarvestedRootCount, 1) | ||
player:setStorageValue(Storage.Oramond.MissionToTakeRoots, 1) | ||
player:setStorageValue(Storage.Oramond.QuestLine, 1) | ||
elseif player:getStorageValue(Storage.Oramond.MissionToTakeRoots) == 1 then | ||
player:setStorageValue(Storage.Oramond.HarvestedRootCount, harvestedCount + 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation |
||
end | ||
elseif((rand >= 50) and (rand < 100)) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Your harvesting attempt destroyed more of the juicy roots than you could salvage.') | ||
item:transform(item.itemid + 2) | ||
addEvent(revertRoot, 300000, toPosition, 23477, 23475) | ||
toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) | ||
end | ||
end | ||
if item.itemid == 23476 then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the end above, use the elseif statment insted. |
||
if((rand >= 1) and (rand < 50)) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You successfully harvest some juicy roots.') | ||
player:addItem(23662, 1) | ||
item:transform(item.itemid + 2) | ||
addEvent(revertRoot, 300000, toPosition, 23478, 23476) | ||
toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) | ||
if player:getStorageValue(Storage.Oramond.MissionToTakeRoots) < 0 then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete the tab |
||
player:setStorageValue(Storage.Oramond.HarvestedRootCount, 1) | ||
player:setStorageValue(Storage.Oramond.MissionToTakeRoots, 1) | ||
player:setStorageValue(Storage.Oramond.QuestLine, 1) | ||
elseif player:getStorageValue(Storage.Oramond.MissionToTakeRoots) == 1 then | ||
player:setStorageValue(Storage.Oramond.HarvestedRootCount, harvestedCount + 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete the tab |
||
end | ||
elseif((rand >= 50) and (rand < 100)) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Your harvesting attempt destroyed more of the juicy roots than you could salvage.') | ||
item:transform(item.itemid + 2) | ||
addEvent(revertRoot, 300000, toPosition, 23478, 23476) | ||
toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) | ||
end | ||
end | ||
return true | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
function onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great update. I hope saying this won't demotivate you, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. easy loop here bra |
||
local amountOfPlayers = 1 | ||
local spectators = Game.getSpectators(Position(33628, 32370, 5), false, true, 20, 20, 20, 20) | ||
if #spectators < amountOfPlayers then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "you need a dreamcatcher device.") | ||
return true | ||
end | ||
|
||
--Unrealized Dream-- | ||
chance = math.random(1,22) | ||
|
||
if chance == 1 then | ||
player:addItem(2111,1) -- Snowball | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You wished for something cool.") | ||
|
||
elseif chance == 2 then | ||
player:addItem(2223,1) -- Rubbish | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You knew it would be some rubbish!") | ||
|
||
elseif chance == 3 then | ||
player:addItem(2114,1) -- Piggy Bank | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about your wealth.") | ||
|
||
elseif chance == 4 then | ||
player:addItem(2745,1) -- Blue Rose | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about spring.") | ||
|
||
elseif chance == 5 then | ||
player:addItem(2072,1) -- Lute | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. Well, part of. You thought about getting rich and a pile of loot...") | ||
|
||
elseif chance == 6 then | ||
player:addItem(9074,1) -- Present (Explosive) | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You were that curious for the surprise.") | ||
|
||
elseif chance == 7 then | ||
player:addItem(2657,1) -- Simple Dress | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and ... Oops, where did that dream come from?") | ||
|
||
elseif chance == 8 then | ||
player:addItem(22604,1) -- Silver Prison Key | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about a true challenge.") | ||
|
||
elseif chance == 9 then | ||
player:addItem(7735,1) -- Spellwand | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. Somehow you seemed to get distracted when you thought of Ferumbras.") | ||
|
||
elseif chance == 10 then | ||
player:addItem(5792,1) -- Die | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just wondered if you\'d be lucky this time.") | ||
|
||
elseif chance == 11 then | ||
player:addItem(2560,1) -- Mirror | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You shouldn\'t really think about yourself that often.") | ||
|
||
elseif chance == 12 then | ||
player:addItem(22396,1) -- Cluster of Solace | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You thought of your last night\'s dream, You try to concentrate and your dream comes true. You couldn\'t focus on anything specific.") | ||
|
||
elseif chance == 13 then | ||
player:addItem(2666,1) -- Meat | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. Unfortunately you were subconsciouly thinking about something to eat.") | ||
|
||
elseif chance == 14 then | ||
player:addItem(5929,1) -- Goldfish Bowl | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about a loyal companion.") | ||
|
||
elseif chance == 15 then | ||
player:addItem(22605,1) -- Copper Prison Key | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about a true challenge.") | ||
|
||
elseif chance == 16 then | ||
player:addItem(22606,1) -- Bronze Prison Key | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about a true challenge.") | ||
|
||
elseif chance == 17 then | ||
player:addItem(22607,1) -- Golden Prison Key | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about a true challenge.") | ||
|
||
elseif chance == 18 then | ||
player:addItem(2121,1) -- Wedding Ring | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You wonder what were you thinking about.") | ||
|
||
elseif chance == 19 then | ||
player:addItem(2355,1) -- Stuffed Bunny | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You just thought about having a true friend.") | ||
|
||
elseif chance == 20 then | ||
player:addItem(22609,1) -- Dream Warden Claw | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You wonder what were you thinking about.") | ||
|
||
elseif chance == 21 then | ||
player:addItem(7459,1) -- Pair of Earmuffs | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. Sadly you had cold ears just in that moment.") | ||
|
||
elseif chance == 22 then | ||
player:addItem(13537,1) -- Bag of Apple Slices | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to concentrate and your dream comes true. You thought about your sore feet.") | ||
end | ||
|
||
item:getPosition():sendMagicEffect(26) | ||
item:remove(1) | ||
return true | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9001,7 +9001,7 @@ | |
<item id="5791" article="a" name="stuffed dragon"> | ||
<attribute key="weight" value="850" /> | ||
</item> | ||
<item fromid="5792" toid="5797" article="a" name="dice"> | ||
<item fromid="5792" toid="5797" article="a" name="die"> | ||
<attribute key="weight" value="200" /> | ||
</item> | ||
<item id="5798" article="an" name="abacus"> | ||
|
@@ -24106,9 +24106,13 @@ | |
<item id="16096" article="a" name="dung ball"> | ||
<attribute key="weight" value="190" /> | ||
</item> | ||
<item id="16099" article="a" name="cake cabinet kit"> | ||
<attribute key="description" value="Use it in your house to construct a cake cabinet." /> | ||
<attribute key="weight" value="7500" /> | ||
<item id="16097" article="a" name="cake cabinet"> | ||
<attribute key="containerSize" value="8" /> | ||
<attribute key="rotateTo" value="16098" /> | ||
</item> | ||
<item id="16098" article="a" name="cake cabinet"> | ||
<attribute key="containerSize" value="8" /> | ||
<attribute key="rotateTo" value="16097" /> | ||
</item> | ||
<item id="16101" article="a" name="premium scroll"> | ||
<attribute key="description" value="Using this scroll will add 30 days of premium time to your account once." /> | ||
|
@@ -30648,7 +30652,7 @@ | |
<attribute key="slotType" value="two-handed" /> | ||
<attribute key="weight" value="9600" /> | ||
</item> | ||
<item id="23662" name="juicy roots"> | ||
<item id="23662" name="juicy roots" plural="juicy roots"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need since the name dosen't change |
||
<attribute key="weight" value="200" /> | ||
</item> | ||
<item id="23663" article="a" name="feedbag"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the tab