repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
carloseduardosx/sky-force-infinite
src/objects/laser.lua
1
1695
local sprite = require( "src.images.sprite" ) local Laser = {} function Laser.fire( application, physics ) audio.play( application.soundTable.shotSound, { channel=2 } ) local newLaser = display.newImageRect( application.mainGroup, sprite.objectSheet, 5, 14, 40 ) table.insert( application.lasersTable, newLaser ) physics.addBody( newLaser, "dynamic", { isSensor=true } ) newLaser.isBullet = true newLaser.myName = "laser" newLaser.x = application.ship.x newLaser.y = application.ship.y newLaser:toBack() newLaser:setLinearVelocity( 0, application.laserLinearVelocityY ) end function Laser.slowMotion( application, isPause ) if ( isPause == true) then application.laserLinearVelocityY = 0 else application.laserLinearVelocityY = application.laserSlowMotionLinearVelocityY end for i = #application.lasersTable, 1, -1 do application.lasersTable[i]:setLinearVelocity( 0, application.laserLinearVelocityY ) end end function Laser.speedUp( application ) application.laserLinearVelocityY = application.laserFastLinearVelocityY for i = #application.lasersTable, 1, -1 do application.lasersTable[i]:setLinearVelocity( 0, application.laserLinearVelocityY ) end end function Laser.generator( application, physics ) return function() Laser.fire( application, physics ) for i = #application.lasersTable, 1, -1 do local currentLaser = application.lasersTable[i] if ( currentLaser.y < -40 ) then display.remove( currentLaser ) table.remove( application.lasersTable, i ) end end end end return Laser
apache-2.0
cleytonk/globalfull
data/actions/scripts/other/bed_modification_kits.lua
12
1580
local BEDS = { [7904] = {{7811, 7812}, {7813, 7814}}, -- green kit [7905] = {{7819, 7820}, {7821, 7822}}, -- yellow kit [7906] = {{7815, 7816}, {7817, 7818}}, -- red kit [7907] = {{1754, 1755}, {1760, 1761}}, -- removal kit [20252] = {{20197, 20198}, {20199, 20200}} -- canopy kit } local function internalBedTransform(item, itemEx, toPosition, ids) local targetItem = Item(itemEx.uid) targetItem:transform(ids[1]) targetItem:getPosition():sendMagicEffect(CONST_ME_POFF) toPosition:getTile():getItemByType(ITEM_TYPE_BED):transform(ids[2]) toPosition:sendMagicEffect(CONST_ME_POFF) Item(item.uid):remove() end function onUse(cid, item, fromPosition, itemEx, toPosition) local newBed = BEDS[item.itemid] if not newBed then return false end local tile = toPosition:getTile() if not tile or not tile:getHouse() then return false end if itemEx.itemid == newBed[1][1] or itemEx.itemid == newBed[2][1] then Player(cid):sendTextMessage(MESSAGE_STATUS_SMALL, "You already have this bed modification.") return true end for kit, bed in pairs(BEDS) do if bed[1][1] == itemEx.itemid or isInArray({1758, 5502, 18027}, itemEx.itemid) then toPosition:sendMagicEffect(CONST_ME_POFF) toPosition.y = toPosition.y + 1 internalBedTransform(item, itemEx, toPosition, newBed[1]) break elseif bed[2][1] == itemEx.itemid or isInArray({1756, 5500, 18029}, itemEx.itemid) then toPosition:sendMagicEffect(CONST_ME_POFF) toPosition.x = toPosition.x + 1 internalBedTransform(item, itemEx, toPosition, newBed[2]) break end end return true end
gpl-2.0
MalRD/darkstar
scripts/zones/Temple_of_Uggalepih/npcs/_4fx.lua
9
1492
----------------------------------- -- Area: Temple of Uggalepih -- NPC: Granite Door -- !pos 340 0.1 329 159 ----------------------------------- local ID = require("scripts/zones/Temple_of_Uggalepih/IDs") require("scripts/globals/keyitems") require("scripts/globals/missions") require("scripts/globals/npc_util") ----------------------------------- function onTrade(player, npc, trade) if npcUtil.tradeHas(trade, 1143) and player:getZPos() < 332 then -- Cursed Key if player:getCurrentMission(WINDURST) == dsp.mission.id.windurst.AWAKENING_OF_THE_GODS and player:getCharVar("MissionStatus") == 4 then player:confirmTrade() player:startEvent(23) else player:confirmTrade() player:messageSpecial(ID.text.YOUR_KEY_BREAKS, 0, 1143) player:startEvent(25) end else player:messageSpecial(ID.text.NOTHING_HAPPENS) end end function onTrigger(player, npc) if player:getZPos() < 332 then player:messageSpecial(ID.text.DOOR_LOCKED) else player:startEvent(26) end end function onEventUpdate(player, csid, option) end function onEventFinish(player, csid, option) if csid == 23 then player:setPos(340, 0, 333) player:delKeyItem(dsp.ki.BLANK_BOOK_OF_THE_GODS) player:addKeyItem(dsp.ki.BOOK_OF_THE_GODS) player:messageSpecial(ID.text.KEYITEM_OBTAINED, dsp.ki.BOOK_OF_THE_GODS) player:setCharVar("MissionStatus", 5) end end
gpl-3.0
Lsty/ygopro-scripts
c86868952.lua
3
1948
--武神器-ヤツカ function c86868952.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(86868952,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(c86868952.condition) e1:SetCost(c86868952.cost) e1:SetTarget(c86868952.target) e1:SetOperation(c86868952.operation) c:RegisterEffect(e1) end function c86868952.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end function c86868952.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end function c86868952.filter(c) return c:IsFaceup() and c:IsSetCard(0x88) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) end function c86868952.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86868952.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c86868952.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,c86868952.filter,tp,LOCATION_MZONE,0,1,1,nil) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_OATH) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(c86868952.ftarget) e1:SetLabel(g:GetFirst():GetFieldID()) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function c86868952.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() end function c86868952.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END) e1:SetValue(1) tc:RegisterEffect(e1) end end
gpl-2.0
MalRD/darkstar
scripts/zones/Cloister_of_Flames/bcnms/trial-size_trial_by_fire.lua
3
1848
----------------------------------- -- Area: Cloister of Flames -- BCNM: Trial-size Trial by Fire ----------------------------------- local ID = require("scripts/zones/Cloister_of_Flames/IDs") require("scripts/globals/battlefield") require("scripts/globals/quests") ----------------------------------- function onBattlefieldTick(battlefield, tick) dsp.battlefield.onBattlefieldTick(battlefield, tick) end function onBattlefieldRegister(player, battlefield) end function onBattlefieldEnter(player, battlefield) end function onBattlefieldLeave(player, battlefield, leavecode) if leavecode == dsp.battlefield.leaveCode.WON then local name, clearTime, partySize = battlefield:getRecord() local arg8 = (player:getQuestStatus(OUTLANDS, dsp.quest.id.otherAreas.TRIAL_SIZE_TRIAL_BY_FIRE) == QUEST_COMPLETED) and 1 or 0 player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar("[cs]bit"), arg8) elseif leavecode == dsp.battlefield.leaveCode.LOST then player:setCharVar("TrialSizeFire_date", tonumber(os.date("%j"))) -- If you lose, you need to wait 1 real day player:startEvent(32002) end end function onEventUpdate(player, csid, option) end function onEventFinish(player, csid, option) if csid == 32001 then if not player:hasSpell(298) then player:addSpell(298) player:messageSpecial(ID.text.IFRIT_UNLOCKED, 0, 0, 0) end if not player:hasItem(4181) then player:addItem(4181) -- Scroll of instant warp player:messageSpecial(ID.text.ITEM_OBTAINED, 4181) end player:setCharVar("TrialSizeFire_date", 0) player:addFame(KAZHAM, 30) player:completeQuest(OUTLANDS, dsp.quest.id.outlands.TRIAL_SIZE_TRIAL_BY_FIRE) end end
gpl-3.0
mortezamosavy999/zetaindex
plugins/google.lua
336
1323
do local function googlethat(query) local url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&safe=active&&rsz=5&' local parameters = 'q='..(URL.escape(query) or '') -- Do the request local res, code = https.request(url..parameters) if code ~=200 then return nil end local data = json:decode(res) local results = {} for key,result in ipairs(data.responseData.results) do table.insert(results, { result.titleNoFormatting, result.unescapedUrl or result.url }) end return results end local function stringlinks(results) local stringresults='' i = 0 for key,val in ipairs(results) do i = i+1 stringresults=stringresults..i..'. '..val[1]..'\n'..val[2]..'\n' end return stringresults end local function run(msg, matches) -- comment this line if you want this plugin works in private message. if not is_chat_msg(msg) then return nil end local results = googlethat(matches[1]) return stringlinks(results) end return { description = 'Returns five results from Google. Safe search is enabled by default.', usage = ' !google [terms]: Searches Google and send results', patterns = { '^!google (.*)$', '^%.[g|G]oogle (.*)$' }, run = run } end
gpl-2.0
peterkohaut/scummvm
devtools/create_ultima/files/ultima6/scripts/se/ending.lua
19
1680
local lua_file = nil lua_file = nuvie_load("common/intro_common.lua"); lua_file(); function play() local g_img_tbl = image_load_all("endgame.lzc") -- 0,0 Party -- 0,1 Lord British -- 0,2 Aiela -- 0,3 Tristia -- 0,4 Leaving Savage Empire local bg = sprite_new(g_img_tbl[0][0], 0, 0, true) canvas_set_palette("savage.pal", 1) canvas_set_opacity(0xff); mouse_cursor_visible(false) canvas_set_update_interval(25) local txt = sprite_new(nil, 28, 135, true) txt.text_color = 0 txt.text = i18n("IMG1_TXT1_END") txt.text_align = 1 fade_in() wait_for_input() txt.text = i18n("IMG1_TXT2_END") wait_for_input() txt.text = i18n("IMG1_TXT3_END") wait_for_input() bg.image = g_img_tbl[0][1] txt.text = i18n("IMG2_TXT1_END") wait_for_input() txt.text = i18n("IMG2_TXT2_END") wait_for_input() -- TODO: Add Check for Love with Aiela bg.image = g_img_tbl[0][2] txt.text = i18n("IMG3_TXT1_END") wait_for_input() txt.text = i18n("IMG3_TXT2_END") wait_for_input() txt.text = i18n("IMG3_TXT3_END") wait_for_input() -- TODO: Add Check for Love with Tristia bg.image = g_img_tbl[0][3] txt.text = i18n("IMG4_TXT1_END") wait_for_input() txt.text = i18n("IMG4_TXT2_END") wait_for_input() bg.image = g_img_tbl[0][4] txt.text = i18n("IMG5_TXT1_END") wait_for_input() txt.text = i18n("IMG5_TXT2_END") wait_for_input() txt.text = i18n("IMG5_TXT3_END") wait_for_input() txt.text = i18n("IMG5_TXT4_END") wait_for_input() bg.image = g_img_tbl[0][1] txt.text = i18n("IMG2_TXT3_END") -- TODO - Add Years, Months, Days to String wait_for_input() end play()
gpl-3.0
MalRD/darkstar
scripts/globals/weaponskills/realmrazer.lua
10
1499
----------------------------------- -- Realmrazer -- Club weapon skill -- Skill Level: 357 -- Delivers a seven-hit attack. params.accuracy varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Shadow Gorget & Soil Gorget. -- Aligned with the Shadow Belt & Soil Belt. -- Element: None -- Modifiers: MND:73~85% -- 100%TP 200%TP 300%TP -- .88 .88 .88 ----------------------------------- require("scripts/globals/status") require("scripts/globals/settings") require("scripts/globals/weaponskills") ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {} params.numHits = 7 params.ftp100 = 0.88 params.ftp200 = 0.88 params.ftp300 = 0.88 params.str_wsc = 0.0 params.dex_wsc = 0.0 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.85 + (player:getMerit(dsp.merit.REALMRAZER) / 100) params.chr_wsc = 0.0 params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0 params.canCrit = false params.acc100 = 0.8 params.acc200= 0.9 params.acc300= 1 params.atk100 = 1; params.atk200 = 1; params.atk300 = 1; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.mnd_wsc = 0.7 + (player:getMerit(dsp.merit.REALMRAZER) / 100) end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) return tpHits, extraHits, criticalHit, damage end
gpl-3.0
Lsty/ygopro-scripts
c82263578.lua
9
1263
--戦火の残滓 function c82263578.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(c82263578.condition) e1:SetTarget(c82263578.target) e1:SetOperation(c82263578.activate) c:RegisterEffect(e1) end function c82263578.condition(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end function c82263578.filter(c) return c:IsAttribute(ATTRIBUTE_WATER+ATTRIBUTE_WIND) and c:IsAbleToHand() end function c82263578.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c82263578.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c82263578.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c82263578.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c82263578.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
gpl-2.0
bforbis/thrift
lib/lua/TTransport.lua
115
2800
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you may not use this file except in compliance -- with the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, -- software distributed under the License is distributed on an -- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -- KIND, either express or implied. See the License for the -- specific language governing permissions and limitations -- under the License. -- require 'Thrift' TTransportException = TException:new { UNKNOWN = 0, NOT_OPEN = 1, ALREADY_OPEN = 2, TIMED_OUT = 3, END_OF_FILE = 4, INVALID_FRAME_SIZE = 5, INVALID_TRANSFORM = 6, INVALID_CLIENT_TYPE = 7, errorCode = 0, __type = 'TTransportException' } function TTransportException:__errorCodeToString() if self.errorCode == self.NOT_OPEN then return 'Transport not open' elseif self.errorCode == self.ALREADY_OPEN then return 'Transport already open' elseif self.errorCode == self.TIMED_OUT then return 'Transport timed out' elseif self.errorCode == self.END_OF_FILE then return 'End of file' elseif self.errorCode == self.INVALID_FRAME_SIZE then return 'Invalid frame size' elseif self.errorCode == self.INVALID_TRANSFORM then return 'Invalid transform' elseif self.errorCode == self.INVALID_CLIENT_TYPE then return 'Invalid client type' else return 'Default (unknown)' end end TTransportBase = __TObject:new{ __type = 'TTransportBase' } function TTransportBase:isOpen() end function TTransportBase:open() end function TTransportBase:close() end function TTransportBase:read(len) end function TTransportBase:readAll(len) local buf, have, chunk = '', 0 while have < len do chunk = self:read(len - have) have = have + string.len(chunk) buf = buf .. chunk if string.len(chunk) == 0 then terror(TTransportException:new{ errorCode = TTransportException.END_OF_FILE }) end end return buf end function TTransportBase:write(buf) end function TTransportBase:flush() end TServerTransportBase = __TObject:new{ __type = 'TServerTransportBase' } function TServerTransportBase:listen() end function TServerTransportBase:accept() end function TServerTransportBase:close() end TTransportFactoryBase = __TObject:new{ __type = 'TTransportFactoryBase' } function TTransportFactoryBase:getTransport(trans) return trans end
apache-2.0
moody2020/TH3_BOSS
plugins/owners.lua
55
23720
local function lock_group_namemod(msg, data, target) local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'yes' then return 'Group name is already locked' else data[tostring(target)]['settings']['lock_name'] = 'yes' save_data(_config.moderation.data, data) rename_chat('chat#id'..target, group_name_set, ok_cb, false) return 'Group name has been locked' end end local function unlock_group_namemod(msg, data, target) local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'no' then return 'Group name is already unlocked' else data[tostring(target)]['settings']['lock_name'] = 'no' save_data(_config.moderation.data, data) return 'Group name has been unlocked' end end local function lock_group_floodmod(msg, data, target) local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'yes' then return 'Group flood is locked' else data[tostring(target)]['settings']['flood'] = 'yes' save_data(_config.moderation.data, data) return 'Group flood has been locked' end end local function unlock_group_floodmod(msg, data, target) local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'no' then return 'Group flood is not locked' else data[tostring(target)]['settings']['flood'] = 'no' save_data(_config.moderation.data, data) return 'Group flood has been unlocked' end end local function lock_group_membermod(msg, data, target) local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'yes' then return 'Group members are already locked' else data[tostring(target)]['settings']['lock_member'] = 'yes' save_data(_config.moderation.data, data) end return 'Group members has been locked' end local function unlock_group_membermod(msg, data, target) local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'no' then return 'Group members are not locked' else data[tostring(target)]['settings']['lock_member'] = 'no' save_data(_config.moderation.data, data) return 'Group members has been unlocked' end end local function unlock_group_photomod(msg, data, target) local group_photo_lock = data[tostring(target)]['settings']['lock_photo'] if group_photo_lock == 'no' then return 'Group photo is not locked' else data[tostring(target)]['settings']['lock_photo'] = 'no' save_data(_config.moderation.data, data) return 'Group photo has been unlocked' end end local function lock_group_arabic(msg, data, target) local group_arabic_lock = data[tostring(target)]['settings']['lock_arabic'] if group_arabic_lock == 'yes' then return 'Arabic is already locked' else data[tostring(target)]['settings']['lock_arabic'] = 'yes' save_data(_config.moderation.data, data) return 'Arabic has been locked' end end local function unlock_group_arabic(msg, data, target) local group_arabic_lock = data[tostring(target)]['settings']['lock_arabic'] if group_arabic_lock == 'no' then return 'Arabic/Persian is already unlocked' else data[tostring(target)]['settings']['lock_arabic'] = 'no' save_data(_config.moderation.data, data) return 'Arabic/Persian has been unlocked' end end local function lock_group_links(msg, data, target) local group_link_lock = data[tostring(target)]['settings']['lock_link'] if group_link_lock == 'yes' then return 'Link posting is already locked' else data[tostring(target)]['settings']['lock_link'] = 'yes' save_data(_config.moderation.data, data) return 'Link posting has been locked' end end local function unlock_group_links(msg, data, target) local group_link_lock = data[tostring(target)]['settings']['lock_link'] if group_link_lock == 'no' then return 'Link posting is not locked' else data[tostring(target)]['settings']['lock_link'] = 'no' save_data(_config.moderation.data, data) return 'Link posting has been unlocked' end end local function lock_group_spam(msg, data, target) local group_spam_lock = data[tostring(target)]['settings']['lock_spam'] if group_spam_lock == 'yes' then return 'SuperGroup spam is already locked' else data[tostring(target)]['settings']['lock_spam'] = 'yes' save_data(_config.moderation.data, data) return 'SuperGroup spam has been locked' end end local function unlock_group_spam(msg, data, target) local group_spam_lock = data[tostring(target)]['settings']['lock_spam'] if group_spam_lock == 'no' then return 'SuperGroup spam is not locked' else data[tostring(target)]['settings']['lock_spam'] = 'no' save_data(_config.moderation.data, data) return 'SuperGroup spam has been unlocked' end end local function lock_group_sticker(msg, data, target) local group_sticker_lock = data[tostring(target)]['settings']['lock_sticker'] if group_sticker_lock == 'yes' then return 'Sticker posting is already locked' else data[tostring(target)]['settings']['lock_sticker'] = 'yes' save_data(_config.moderation.data, data) return 'Sticker posting has been locked' end end local function unlock_group_sticker(msg, data, target) local group_sticker_lock = data[tostring(target)]['settings']['lock_sticker'] if group_sticker_lock == 'no' then return 'Sticker posting is already unlocked' else data[tostring(target)]['settings']['lock_sticker'] = 'no' save_data(_config.moderation.data, data) return 'Sticker posting has been unlocked' end end local function lock_group_contacts(msg, data, target) if not is_momod(msg) then return end local group_rtl_lock = data[tostring(target)]['settings']['lock_contacts'] if group_contacts_lock == 'yes' then return 'Contact posting is already locked' else data[tostring(target)]['settings']['lock_contacts'] = 'yes' save_data(_config.moderation.data, data) return 'Contact posting has been locked' end end local function unlock_group_contacts(msg, data, target) if not is_momod(msg) then return end local group_contacts_lock = data[tostring(target)]['settings']['lock_contacts'] if group_contacts_lock == 'no' then return 'Contact posting is already unlocked' else data[tostring(target)]['settings']['lock_contacts'] = 'no' save_data(_config.moderation.data, data) return 'Contact posting has been unlocked' end end local function enable_strict_rules(msg, data, target) if not is_momod(msg) then return end local group_rtl_lock = data[tostring(target)]['settings']['strict'] if strict == 'yes' then return 'Settings are already strictly enforced' else data[tostring(target)]['settings']['strict'] = 'yes' save_data(_config.moderation.data, data) return 'Settings will be strictly enforced' end end local function disable_strict_rules(msg, data, target) if not is_momod(msg) then return end local group_contacts_lock = data[tostring(target)]['settings']['strict'] if strict == 'no' then return 'Settings will not be strictly enforced' else data[tostring(target)]['settings']['strict'] = 'no' save_data(_config.moderation.data, data) return 'Settings are not strictly enforced' end end -- Show group settings local function show_group_settingsmod(msg, data, target) if data[tostring(target)] then if data[tostring(target)]['settings']['flood_msg_max'] then NUM_MSG_MAX = tonumber(data[tostring(target)]['settings']['flood_msg_max']) print('custom'..NUM_MSG_MAX) else NUM_MSG_MAX = 5 end end local bots_protection = "Yes" if data[tostring(target)]['settings']['lock_bots'] then bots_protection = data[tostring(target)]['settings']['lock_bots'] end local leave_ban = "no" if data[tostring(target)]['settings']['leave_ban'] then leave_ban = data[tostring(target)]['settings']['leave_ban'] end local public = "no" if data[tostring(target)]['settings'] then if data[tostring(target)]['settings']['public'] then public = data[tostring(target)]['settings']['public'] end end local settings = data[tostring(target)]['settings'] local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member.."\nLock group leave : "..leave_ban.."\nflood sensitivity : "..NUM_MSG_MAX.."\nBot protection : "..bots_protection.."\nPublic: "..public return text end -- Show SuperGroup settings local function show_super_group_settings(msg, data, target) if data[tostring(target)] then if data[tostring(target)]['settings']['flood_msg_max'] then NUM_MSG_MAX = tonumber(data[tostring(target)]['settings']['flood_msg_max']) print('custom'..NUM_MSG_MAX) else NUM_MSG_MAX = 5 end end if data[tostring(target)]['settings'] then if not data[tostring(target)]['settings']['public'] then data[tostring(target)]['settings']['public'] = 'no' end end if data[tostring(target)]['settings'] then if not data[tostring(target)]['settings']['lock_rtl'] then data[tostring(target)]['settings']['lock_rtl'] = 'no' end end if data[tostring(target)]['settings'] then if not data[tostring(target)]['settings']['lock_member'] then data[tostring(target)]['settings']['lock_member'] = 'no' end end local settings = data[tostring(target)]['settings'] local text = "SuperGroup settings for "..target..":\nLock links : "..settings.lock_link.."\nLock flood: "..settings.flood.."\nLock spam: "..settings.lock_spam.."\nLock Arabic: "..settings.lock_arabic.."\nLock Member: "..settings.lock_member.."\nLock RTL: "..settings.lock_rtl.."\nLock sticker: "..settings.lock_sticker.."\nPublic: "..settings.public.."\nStrict settings: "..settings.strict return text end local function set_rules(target, rules) local data = load_data(_config.moderation.data) local data_cat = 'rules' data[tostring(target)][data_cat] = rules save_data(_config.moderation.data, data) return 'Set group rules to:\n'..rules end local function set_description(target, about) local data = load_data(_config.moderation.data) local data_cat = 'description' data[tostring(target)][data_cat] = about save_data(_config.moderation.data, data) return 'Set group description to:\n'..about end local function run(msg, matches) if msg.to.type == 'user' then local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", " ") local chat_id = matches[1] local receiver = get_receiver(msg) local data = load_data(_config.moderation.data) if matches[2] == 'ban' then local chat_id = matches[1] if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end if tonumber(matches[3]) == tonumber(our_id) then return false end local user_id = matches[3] if tonumber(matches[3]) == tonumber(msg.from.id) then return "You can't ban yourself" end ban_user(matches[3], matches[1]) local name = user_print_name(msg.from) savelog(matches[1], name.." ["..msg.from.id.."] banned user ".. matches[3]) return 'User '..user_id..' banned' end if matches[2] == 'unban' then if tonumber(matches[3]) == tonumber(our_id) then return false end local chat_id = matches[1] if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local user_id = matches[3] if tonumber(matches[3]) == tonumber(msg.from.id) then return "You can't unban yourself" end local hash = 'banned:'..matches[1] redis:srem(hash, user_id) savelog(matches[1], name.." ["..msg.from.id.."] unbanned user ".. matches[3]) return 'User '..user_id..' unbanned' end if matches[2] == 'kick' then local chat_id = matches[1] if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end if tonumber(matches[3]) == tonumber(our_id) then return false end local user_id = matches[3] if tonumber(matches[3]) == tonumber(msg.from.id) then return "You can't kick yourself" end kick_user(matches[3], chat_id) savelog(matches[1], name.." ["..msg.from.id.."] kicked user ".. matches[3]) return 'User '..user_id..' kicked' end if matches[2] == 'clean' then if matches[3] == 'modlist' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end for k,v in pairs(data[tostring(matches[1])]['moderators']) do data[tostring(matches[1])]['moderators'][tostring(k)] = nil save_data(_config.moderation.data, data) end savelog(matches[1], name.." ["..msg.from.id.."] cleaned modlist") end if matches[3] == 'rules' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local data_cat = 'rules' data[tostring(matches[1])][data_cat] = nil save_data(_config.moderation.data, data) savelog(matches[1], name.." ["..msg.from.id.."] cleaned rules") end if matches[3] == 'about' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local data_cat = 'description' data[tostring(matches[1])][data_cat] = nil save_data(_config.moderation.data, data) savelog(matches[1], name.." ["..msg.from.id.."] cleaned about") channel_set_about(receiver, about_text, ok_cb, false) return "About has been cleaned" end if matches[3] == 'mutelist' then chat_id = string.match(matches[1], '^%d+$') local hash = 'mute_user:'..chat_id redis:del(hash) return "Mutelist Cleaned" end end if matches[2] == "setflood" then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end if tonumber(matches[3]) < 5 or tonumber(matches[3]) > 20 then return "Wrong number,range is [5-20]" end local flood_max = matches[3] data[tostring(matches[1])]['settings']['flood_msg_max'] = flood_max save_data(_config.moderation.data, data) savelog(matches[1], name.." ["..msg.from.id.."] set flood to ["..matches[3].."]") return 'Group flood has been set to '..matches[3] end if matches[2] == 'lock' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local target = matches[1] local group_type = data[tostring(matches[1])]['group_type'] if matches[3] == 'name' then savelog(matches[1], name.." ["..msg.from.id.."] locked name ") return lock_group_namemod(msg, data, target) end if matches[3] == 'member' then savelog(matches[1], name.." ["..msg.from.id.."] locked member ") return lock_group_membermod(msg, data, target) end if matches[3] == 'arabic' then savelog(matches[1], name.." ["..msg.from.id.."] locked arabic ") return lock_group_arabic(msg, data, target) end if matches[3] == 'links' then savelog(matches[1], name.." ["..msg.from.id.."] locked links ") return lock_group_links(msg, data, target) end if matches[3] == 'spam' then savelog(matches[1], name.." ["..msg.from.id.."] locked spam ") return lock_group_spam(msg, data, target) end if matches[3] == 'rtl' then savelog(matches[1], name.." ["..msg.from.id.."] locked RTL chars. in names") return unlock_group_rtl(msg, data, target) end if matches[3] == 'sticker' then savelog(matches[1], name.." ["..msg.from.id.."] locked sticker") return lock_group_sticker(msg, data, target) end end if matches[2] == 'unlock' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local target = matches[1] local group_type = data[tostring(matches[1])]['group_type'] if matches[3] == 'name' then savelog(matches[1], name.." ["..msg.from.id.."] unlocked name ") return unlock_group_namemod(msg, data, target) end if matches[3] == 'member' then savelog(matches[1], name.." ["..msg.from.id.."] unlocked member ") return unlock_group_membermod(msg, data, target) end if matches[3] == 'arabic' then savelog(matches[1], name.." ["..msg.from.id.."] unlocked arabic ") return unlock_group_arabic(msg, data, target) end if matches[3] == 'links' and group_type == "SuperGroup" then savelog(matches[1], name.." ["..msg.from.id.."] unlocked links ") return unlock_group_links(msg, data, target) end if matches[3] == 'spam' and group_type == "SuperGroup" then savelog(matches[1], name.." ["..msg.from.id.."] unlocked spam ") return unlock_group_spam(msg, data, target) end if matches[3] == 'rtl' then savelog(matches[1], name.." ["..msg.from.id.."] unlocked RTL chars. in names") return unlock_group_rtl(msg, data, target) end if matches[3] == 'sticker' and group_type == "SuperGroup" then savelog(matches[1], name.." ["..msg.from.id.."] unlocked sticker") return unlock_group_sticker(msg, data, target) end if matches[3] == 'contacts' and group_type == "SuperGroup" then savelog(matches[1], name_log.." ["..msg.from.id.."] locked contact posting") return lock_group_contacts(msg, data, target) end if matches[3] == 'strict' and group_type == "SuperGroup" then savelog(matches[1], name_log.." ["..msg.from.id.."] locked enabled strict settings") return enable_strict_rules(msg, data, target) end end if matches[2] == 'new' then if matches[3] == 'link' then local group_type = data[tostring(matches[1])]['group_type'] if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local function callback_grouplink (extra , success, result) local receiver = 'chat#id'..matches[1] if success == 0 then send_large_msg(receiver, '*Error: Failed to retrieve link* \nReason: Not creator.') end data[tostring(matches[1])]['settings']['set_link'] = result save_data(_config.moderation.data, data) return end local function callback_superlink (extra , success, result) vardump(result) local receiver = 'channel#id'..matches[1] local user = extra.user if success == 0 then data[tostring(matches[1])]['settings']['set_link'] = nil save_data(_config.moderation.data, data) return send_large_msg(user, '*Error: Failed to retrieve link* \nReason: Not creator.\n\nIf you have the link, please use /setlink to set it') else data[tostring(matches[1])]['settings']['set_link'] = result save_data(_config.moderation.data, data) return send_large_msg(user, "Created a new link") end end if group_type == "Group" then local receiver = 'chat#id'..matches[1] savelog(matches[1], name.." ["..msg.from.id.."] created/revoked group link ") export_chat_link(receiver, callback_grouplink, false) return "Created a new new link ! \n owner can get it by /owners "..matches[1].." get link" elseif group_type == "SuperGroup" then local receiver = 'channel#id'..matches[1] local user = 'user#id'..msg.from.id savelog(matches[1], name.." ["..msg.from.id.."] attempted to create a new SuperGroup link") export_channel_link(receiver, callback_superlink, {user = user}) end end end if matches[2] == 'get' then if matches[3] == 'link' then if not is_owner2(msg.from.id, chat_id) then return "You are not the owner of this group" end local group_link = data[tostring(matches[1])]['settings']['set_link'] if not group_link then return "Create a link using /newlink first !" end savelog(matches[1], name.." ["..msg.from.id.."] requested group link ["..group_link.."]") return "Group link:\n"..group_link end end if matches[1] == 'changeabout' and matches[2] then if not is_owner2(msg.from.id, matches[2]) then return "You are not the owner of this group" end local group_type = data[tostring(matches[2])]['group_type'] if group_type == "Group" or group_type == "Realm" then local target = matches[2] local about = matches[3] local name = user_print_name(msg.from) savelog(matches[2], name.." ["..msg.from.id.."] has changed group description to ["..matches[3].."]") return set_description(target, about) elseif group_type == "SuperGroup" then local channel = 'channel#id'..matches[2] local about_text = matches[3] local data_cat = 'description' local target = matches[2] channel_set_about(channel, about_text, ok_cb, false) data[tostring(target)][data_cat] = about_text save_data(_config.moderation.data, data) savelog(matches[2], name.." ["..msg.from.id.."] has changed SuperGroup description to ["..matches[3].."]") return "Description has been set for ["..matches[2]..']' end end if matches[1] == 'viewsettings' and data[tostring(matches[2])]['settings'] then if not is_owner2(msg.from.id, matches[2]) then return "You are not the owner of this group" end local target = matches[2] local group_type = data[tostring(matches[2])]['group_type'] if group_type == "Group" or group_type == "Realm" then savelog(matches[2], name.." ["..msg.from.id.."] requested group settings ") return show_group_settings(msg, data, target) elseif group_type == "SuperGroup" then savelog(matches[2], name.." ["..msg.from.id.."] requested SuperGroup settings ") return show_super_group_settings(msg, data, target) end end if matches[1] == 'changerules' and is_owner2(msg.from.id, matches[2]) then local rules = matches[3] local target = matches[2] local name = user_print_name(msg.from) savelog(matches[2], name.." ["..msg.from.id.."] has changed group rules to ["..matches[3].."]") return set_rules(target, rules) end if matches[1] == 'changename' and is_owner2(msg.from.id, matches[2]) then local new_name = string.gsub(matches[3], '_', ' ') data[tostring(matches[2])]['settings']['set_name'] = new_name local group_name_set = data[tostring(matches[2])]['settings']['set_name'] save_data(_config.moderation.data, data) local chat_to_rename = 'chat#id'..matches[2] local channel_to_rename = 'channel#id'..matches[2] savelog(matches[2], "Group name changed to [ "..new_name.." ] by "..name.." ["..msg.from.id.."]") rename_chat(chat_to_rename, group_name_set, ok_cb, false) rename_channel(channel_to_rename, group_name_set, ok_cb, false) end if matches[1] == 'loggroup' and matches[2] and is_owner2(msg.from.id, matches[2]) then savelog(matches[2], "log file created by owner/support/admin") send_document("user#id".. msg.from.id,"./groups/logs/"..matches[2].."log.txt", ok_cb, false) end end end return { patterns = { "^owners (%d+) ([^%s]+) (.*)$", "^owners (%d+) ([^%s]+)$", "^(changeabout) (%d+) (.*)$", "^(changerules) (%d+) (.*)$", "^(changename) (%d+) (.*)$", "^(viewsettings) (%d+)$", "^(loggroup) (%d+)$" }, run = run }
gpl-2.0
MalRD/darkstar
scripts/zones/Apollyon/npcs/Sentinel_Column.lua
10
1134
----------------------------------- -- Area: Appolyon -- NPC: Sentinel_Column -- !pos 643 0 -609 38 ----------------------------------- require("scripts/globals/limbus"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(221, 127); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) player:updateEvent( 0, player:getBattlefieldTimeLeft(1), -- SW Apollyon player:getBattlefieldTimeLeft(2), -- NW Apollyon player:getBattlefieldTimeLeft(3), -- SE Apollyon player:getBattlefieldTimeLeft(4), -- NE Apollyon player:getBattlefieldTimeLeft(5), -- Central Apollyon player:getBattlefieldTimeLeft(6) -- CS Apollyon ); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) end;
gpl-3.0
MalRD/darkstar
scripts/globals/mobskills/murk.lua
12
1086
--------------------------------------------- -- Murk -- -- Description: Slow and Weight Area of Effect (10.0') -- Type: Enfeebling -- Utsusemi/Blink absorb: Ignores shadows --------------------------------------------- require("scripts/globals/monstertpmoves") require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/msg") --------------------------------------------- function onMobSkillCheck(target, mob, skill) return 0 end function onMobWeaponSkill(target, mob, skill) local slowed = false local weight = false slowed = MobStatusEffectMove(mob, target, dsp.effect.SLOW, 1250, 0, 60) weight = MobStatusEffectMove(mob, target, dsp.effect.WEIGHT, 40, 0, 60) skill:setMsg(dsp.msg.basic.SKILL_ENFEEB_IS) -- display slow first, else weight if slowed == dsp.msg.basic.SKILL_ENFEEB_IS then typeEffect = dsp.effect.SLOW elseif weight == dsp.msg.basic.SKILL_ENFEEB_IS then typeEffect = dsp.effect.WEIGHT else skill:setMsg(dsp.msg.basic.SKILL_MISS) end return typeEffect end
gpl-3.0
LuaDist2/tethys
tethys2/util/LDAP.lua
2
1067
local base = _G local lualdap = require("lualdap") local oo = require "loop.simple" local table = require "table" local config = require "config" local string = require "string" module(...) LDAP = oo.class({}) new = LDAP class = LDAP function LDAP:__init(t) local obj = {} obj.ld = lualdap.open_simple(t.host, t.user, t.pass) if not obj.ld then return end return oo.rawnew(self, obj) end function LDAP:search(q, convert) -- local res = {} -- self:printTable(res, q) -- self:log(table.concat(res)) q.scope = q.scope or "onelevel" return self.ld:search(q) end function LDAP:add(dn, q) -- self:log(sql) return self.ld:add(dn, q) end function LDAP:modify(dn, ...) -- self:log(sql) return self.ld:modify(dn, base.unpack(arg)) end function LDAP:delete(dn, ...) -- self:log(sql) return self.ld:delete(dn, base.unpack(arg)) end function LDAP:close() self.ld:close() end function LDAP:__gc() self:close() end function LDAP:oneOrMany(elem) if base.type(elem) ~= "table" then elem = { elem } end return elem end function LDAP:quote(str) return str end
gpl-3.0
Lsty/ygopro-scripts
c16366944.lua
9
1313
--月光蝶 function c16366944.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(16366944,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(c16366944.condition) e1:SetTarget(c16366944.target) e1:SetOperation(c16366944.operation) c:RegisterEffect(e1) end function c16366944.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c16366944.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(0x6a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c16366944.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c16366944.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c16366944.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c16366944.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
gpl-2.0
GRSSR/yum-server
yumServer.lua
1
3538
os.loadAPI("api/redString") os.loadAPI("api/sovietProtocol") PROTOCOL_CHANNEL = 137 local yum = sovietProtocol.Protocol:new("yum", PROTOCOL_CHANNEL, PROTOCOL_CHANNEL) sovietProtocol.setDebugLevel(0) function getIndex(package) local index = fs.combine(fs.combine("packages", package), "index") if fs.exists(index) then return index else return false end end function getPackageRoot(package) return fs.combine("packages", package) end function parseIndex(index) local f = io.open(index, "r") local ret = {} for line in f:lines() do if line ~= "" and line:sub(1,1) ~= "#" then local details = {} local split = redString.split(line) details.fileName = split[2] details.installLocation = split[3] ret[split[1]] = details end end f:close() return ret end function dispatchPackage(package, replyChannel) local message = "" local parts = parseIndex(getIndex(package)) for name, comp in pairs(parts) do if name:find(":") then local s = redString.split(name, 2, ":") local method = s[1] if method == 'package' then message = message..method.." "..comp.fileName.."\n" elseif method == 'alias' then message = message..method.." "..comp.fileName.." "..comp.installLocation.."\n" end else message = message..name.." "..comp.installLocation.." ".."force\n" end end yum:send("package_list", package, message, replyChannel) end function dispatchComponant(package, componantName, replyChannel) local parts = parseIndex(getIndex(package)) local componant = parts[componantName] if componant then local actualFile = fs.combine(getPackageRoot(package), componant.fileName) local f = fs.open(actualFile, "r") print("sending "..actualFile) if f then local file = f:readAll() f:close() yum:send( "file", componant.installLocation, file, replyChannel) return true else print("file "..actualFile.." does not exist") end end yum:send("error", "404", "File Not Found") end function dispatchFile(fileLocation, replyChannel) local f = fs.open(fileLocation, "r") print("sending "..fileLocation) if f then local file = f:readAll() f:close() yum:send( "file", fileLocation, file, replyChannel) return true else yum:send("error", "404", "File Not Found") return false end end print("Starting Yum Server") while true do local replyChannel, request = yum:listen() if request.method == "install" then local package = request.id local componant = request.body if getIndex(package) then if componant then dispatchComponant(package, componant, replyChannel) else dispatchPackage(package, replyChannel) end else yum:send("error", "404", "Package Not Found", replyChannel) end end if request.method == "list" then local package = request.id if package then dispatchPackage(package, replyChannel) else local packageList = "" for k, package in pairs(fs.list("packages")) do if getIndex(package) then packageList = packageList..package.."\n" end end yum:send("package_list", "ALL", packageList, replyChannel) end end if request.method == "replicate" then if request.id == "list" then local files = "" for k, package in pairs(fs.list("packages")) do for k, file in pairs(fs.list("/packages/"..package)) do if file ~= ".git" then files = files.."/packages/"..package.."/"..file.."\n" end end end yum:send("file_list", "ALL", files, replyChannel) else dispatchFile(request.id, replyChannel) end end end
gpl-2.0
gallenmu/MoonGen
libmoon/lua/lib/turbo/spec/structs_spec.lua
4
6640
--- Turbo.lua Unit test -- -- Copyright 2013 John Abrahamsen -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. local turbo = require "turbo" math.randomseed(turbo.util.gettimeofday()) describe("turbo.structs Namespace", function() describe("Buffer class", function() it("should be constructed right", function() local buf = turbo.structs.buffer() assert.truthy(instanceOf(turbo.structs.buffer, buf)) end) it("should append correctly", function() local buf = turbo.structs.buffer() buf:append_luastr_right("Long string") buf:append_luastr_right(" that is expected to") buf:append_luastr_right(" equal a constant") assert.equal(tostring(buf), "Long string that is expected to equal a constant") end) it("should prepend correctly", function() local buf = turbo.structs.buffer() buf:append_luastr_left(" equal a constant") buf:append_luastr_left(" that is expected to") buf:append_luastr_left("Long string") assert.equal(tostring(buf), "Long string that is expected to equal a constant") end) it("should handle mixed append/prepend", function() local buf = turbo.structs.buffer() local cmp = "" for i = 0, 300 do local dice = math.random() * 10 if dice > 5 then cmp = tostring(dice) .. cmp buf:append_luastr_left(tostring(dice)) else cmp = cmp .. tostring(dice) buf:append_luastr_right(tostring(dice)) end end assert.equal(cmp, tostring(buf)) assert.equal(cmp:len(), buf:len()) end) it("should support == operator", function() local buf = turbo.structs.buffer() buf:append_luastr_right("two equal string should equal!") local buf2 = turbo.structs.buffer() buf2:append_luastr_right("two equal string should equal!") assert.truthy(buf == buf2) buf2:clear() assert.truthy(buf ~= buf2) end) it("should pop correctly", function() local buf = turbo.structs.buffer() for i = 1, 10000 do buf:append_luastr_right("much data in here") end buf:pop_right(string.len("much data in here") * 10000) assert.equal(buf:len(), 0) for i = 1, 10000 do buf:append_luastr_left("much data in here") end assert.has_error(function() buf:pop_right(string.len("much data in here") * 10001) end) buf:shrink() while buf:len() ~= 0 do buf:pop_left(1) end assert.equal(tostring(buf), "") buf:clear() end) it("should support method chaining", function() local buf = turbo.structs.buffer() buf:append_luastr_left("test"):append_luastr_left("test") assert.equal(tostring(buf), "testtest") end) end) describe("Deque class", function() local d it("should be constructed right", function() d = turbo.structs.deque:new() assert.truthy(instanceOf(turbo.structs.deque, d)) end) local append_n_elements = 200 local string1 = "Some string that should be appended" local string2 = "Another string that should be appended" it("should append correctly", function() for i = 1, append_n_elements, 1 do d:append(string1) end assert.equal(d:size(), append_n_elements) end) it("concat should give correct length", function() assert.equal(d:concat():len(), append_n_elements * string1:len()) end) it("should support appendleft", function() d:appendleft(string2) assert.equal(d:peekfirst(), string2) end) it("should support popleft", function() assert.equal(d:popleft(), string2) assert.equal(d:popleft(), string1) end) it("should support pop", function() d:append(string1 .. string2) assert.equal(d:pop(), string1 .. string2) assert.equal(d:pop(), string1) end) it("must report not empty right", function() assert.truthy(d:not_empty()) while d:not_empty() == true do d:pop() end assert.falsy(d:not_empty()) end) it("getn should work correctly", function() d:appendleft("pos3") d:appendleft("pos2") d:appendleft("pos1") assert.equal(d:getn(0), "pos1") assert.equal(d:getn(1), "pos2") assert.equal(d:getn(2), "pos3") end) it("should behave logically", function() local q = turbo.structs.deque:new() local str = "" local n = 0 for i=0, 1000 do math.randomseed(os.time() + i) local action = math.random(0,4) if (action == 0) then q:append("a dog") n = n + 1 elseif (action == 1) then q:appendleft("a cat") n = n + 1 elseif (action == 2) then if (q:not_empty()) then q:popleft() n = n - 1 else assert.equal(nil, q:popleft()) end elseif (action == 3) then if (q:not_empty()) then q:pop() n = n - 1 else assert.equal(nil, q:pop()) end elseif (action == 4) then assert.equal(q:size(), n) end end end) end) end)
mit
Lsty/ygopro-scripts
c16051717.lua
3
2386
--A BF-驟雨のライキリ function c16051717.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) c:EnableReviveLimit() --add type local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c16051717.tncon) e1:SetOperation(c16051717.tnop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetValue(c16051717.valcheck) e2:SetLabelObject(e1) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCategory(CATEGORY_DESTROY) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(c16051717.destg) e3:SetOperation(c16051717.desop) c:RegisterEffect(e3) end function c16051717.valcheck(e,c) local g=c:GetMaterial() if g:IsExists(Card.IsSetCard,1,nil,0x33) then e:GetLabelObject():SetLabel(1) else e:GetLabelObject():SetLabel(0) end end function c16051717.tncon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO and e:GetLabel()==1 end function c16051717.tnop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e1) end function c16051717.filter(c) return c:IsFaceup() and c:IsSetCard(0x33) end function c16051717.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingMatchingCard(c16051717.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end local ct=Duel.GetMatchingGroupCount(c16051717.filter,tp,LOCATION_MZONE,0,e:GetHandler()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end function c16051717.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=tg:Filter(Card.IsRelateToEffect,nil,e) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) end end
gpl-2.0
Lsty/ygopro-scripts
c21051146.lua
3
2083
--ブラッド・マジシャン-煉獄の魔術師- function c21051146.initial_effect(c) c:EnableCounterPermit(0x3001) --add counter local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetCode(EVENT_CHAINING) e0:SetRange(LOCATION_MZONE) e0:SetOperation(aux.chainreg) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetCode(EVENT_CHAIN_SOLVED) e1:SetRange(LOCATION_MZONE) e1:SetOperation(c21051146.acop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(21051146,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetTarget(c21051146.destg) e2:SetOperation(c21051146.desop) c:RegisterEffect(e2) end function c21051146.acop(e,tp,eg,ep,ev,re,r,rp) if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then e:GetHandler():AddCounter(0x3001,1) end end function c21051146.filter(c,cc,tp) local ct=math.ceil(c:GetAttack()/700) if ct==0 then ct=1 end return c:IsFaceup() and c:IsDestructable() and cc:IsCanRemoveCounter(tp,0x3001,ct,REASON_COST) end function c21051146.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c21051146.filter(chkc,e:GetHandler(),tp) end if chk==0 then return Duel.IsExistingTarget(c21051146.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c21051146.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e:GetHandler(),tp) local ct=math.ceil(g:GetFirst():GetAttack()/700) if ct==0 then ct=1 end e:GetHandler():RemoveCounter(tp,0x3001,ct,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c21051146.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
gpl-2.0
Mike325/.vim
lua/completions/init.lua
1
1760
local function general_completion(arglead, _, _, options) local split_components = require('utils.strings').split_components local pattern = table.concat(split_components(arglead, '.'), '.*') pattern = pattern:lower() return vim.tbl_filter(function(opt) return opt:lower():match(pattern) ~= nil end, options) or {} end local completions = { ssh_hosts_completion = function(arglead, cmdline, cursorpos) return general_completion(arglead, cmdline, cursorpos, vim.tbl_keys(STORAGE.hosts)) end, oscyank = function(arglead, cmdline, cursorpos) return general_completion(arglead, cmdline, cursorpos, { 'tmux', 'kitty', 'default' }) end, cmake_build = function(arglead, cmdline, cursorpos) return general_completion( arglead, cmdline, cursorpos, { 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo' } ) end, gitfiles_workspace = function(arglead, cmdline, cursorpos) local gitstatus = require('git.utils').status() local files = {} if gitstatus.workspace then vim.list_extend(files, vim.tbl_keys(gitstatus.workspace)) end if gitstatus.untracked then vim.list_extend(files, gitstatus.untracked) end return general_completion(arglead, cmdline, cursorpos, files) end, gitfiles_stage = function(arglead, cmdline, cursorpos) local gitstatus = require('git.utils').status() local files = {} if gitstatus.stage then vim.list_extend(files, vim.tbl_keys(gitstatus.stage)) end return general_completion(arglead, cmdline, cursorpos, files) end, } _G._completions = completions return completions
mit
MalRD/darkstar
scripts/zones/Arrapago_Reef/npcs/Cutter.lua
9
3104
----------------------------------- -- Area: Arrapago Reef -- NPC: Cutter -- The ship for The Black Coffin Battle (TOAU-15) -- !pos -462 -2 -394 54 ----------------------------------- local ID = require("scripts/zones/Arrapago_Reef/IDs") require("scripts/globals/keyitems") require("scripts/globals/missions") ----------------------------------- function onTrade(player,npc,trade) end function onTrigger(player,npc) if player:getCurrentMission(TOAU) == dsp.mission.id.toau.THE_BLACK_COFFIN and player:hasKeyItem(dsp.ki.EPHRAMADIAN_GOLD_COIN) then player:setLocalVar("theblackcoffinfight",1) player:startEvent(221, 53, -6, 0, 99, 6, 0) elseif player:hasKeyItem(dsp.ki.LIFE_FLOAT) and player:getCharVar("AgainstAllOdds") == 2 then player:setLocalVar("againstalloddsfight",1) player:startEvent(221, 54, -9, 0, 99, 6, 0) else player:messageSpecial(ID.text.YOU_NO_REQS) end end function onEventUpdate(player,csid,option,target) local party = player:getParty() if player:getLocalVar("theblackcoffinfight") == 1 then if party ~= nil then for i,v in ipairs(party) do if not v:hasKeyItem(dsp.ki.EPHRAMADIAN_GOLD_COIN) then player:messageText(target,ID.text.MEMBER_NO_REQS, false) player:instanceEntry(target,1) return elseif v:getZoneID() == player:getZoneID() and v:checkDistance(player) > 50 then player:messageText(target,ID.text.MEMBER_TOO_FAR, false) player:instanceEntry(target,1) return end end end player:createInstance(53,60); player:setLocalVar("theblackcoffinfight",0) elseif player:getLocalVar("againstalloddsfight") == 1 then if (party ~= nil) then for i,v in ipairs(party) do if v:getZoneID() == player:getZoneID() and v:checkDistance(player) > 50 then player:messageText(target,ID.text.MEMBER_TOO_FAR, false) player:instanceEntry(target,1) return end end end player:createInstance(54,60) player:setLocalVar("againstalloddsfight",0) end end function onEventFinish(player,csid,option) if (csid == 221 and option == 4) or csid == 90 then player:setPos(0,0,0,0,60) end end function onInstanceCreated(player,target,instance) if (instance) then player:setInstance(instance) player:instanceEntry(target,4) local party = player:getParty() if (party ~= nil) then for i,v in ipairs(party) do if v:getID() ~= player:getID() and v:getZoneID() == player:getZoneID() then v:setInstance(instance) v:startEvent(90) -- wrong csid, yet better than nothing end end end else player:messageText(target,ID.text.CANNOT_ENTER, false); player:instanceEntry(target,3); end end
gpl-3.0
MalRD/darkstar
scripts/globals/spells/bluemagic/cocoon.lua
12
1218
----------------------------------------- -- Spell: Cocoon -- Enhances defense -- Spell cost: 10 MP -- Monster Type: Vermin -- Spell Type: Magical (Earth) -- Blue Magic Points: 1 -- Stat Bonus: VIT+3 -- Level: 8 -- Casting Time: 1.75 seconds -- Recast Time: 60 seconds -- Duration: 90 seconds -- -- Combos: None ----------------------------------------- require("scripts/globals/bluemagic") require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0 end function onSpellCast(caster,target,spell) local typeEffect = dsp.effect.DEFENSE_BOOST local power = 50 -- Percentage, not amount. local duration = 90 if (caster:hasStatusEffect(dsp.effect.DIFFUSION)) then local diffMerit = caster:getMerit(dsp.merit.DIFFUSION) if (diffMerit > 0) then duration = duration + (duration/100)* diffMerit end caster:delStatusEffect(dsp.effect.DIFFUSION) end if (target:addStatusEffect(typeEffect,power,0,duration) == false) then spell:setMsg(dsp.msg.basic.MAGIC_NO_EFFECT) end return typeEffect end
gpl-3.0
TheSAguy/Natural-Evolution
prototypes/Vanilla_Changes/New_Spitter_Units.lua
1
14776
require "prototypes.Vanilla_Changes.Settings" require "prototypes.Vanilla_Changes.Functions" require "prototypes.Vanilla_Changes.Projectiles" smallspitterscale = 0.5 smallspittertint = {r=0.68, g=0.4, b=0, a=1} smallspitterMk2scale = 0.55 smallspitterMk2tint = {r=0.68, g=0.4, b=0.5, a=1} smallspitterMk3scale = 0.6 smallspitterMk3tint = {r=0.68, g=0.4, b=1, a=1} mediumspitterscale = 0.7 mediumspittertint = {r=0.83, g=0.39, b=0.36, a=0.75} mediumspitterMk2scale = 0.75 mediumspitterMk2tint = {r=0.83, g=0.69, b=0.36, a=0.75} mediumspitterMk3scale = 0.8 mediumspitterMk3tint = {r=0.83, g=0.99, b=0.36, a=0.75} bigspitterscale = 1 bigspittertint = {r=0.54, g=0.58, b=0.85, a=0.6} bigspitterMk2scale = 1.05 bigspitterMk2tint = {r=0.74, g=0.58, b=0.85, a=0.6} bigspitterMk3scale = 1.1 bigspitterMk3tint = {r=0.94, g=0.58, b=0.85, a=0.6} behemothspitterscale = 2 behemothspittertint = {r=0.3, g=0.9, b=0.3, a=0.75} data:extend( { ---- Vanilla Small Spitter --[[ { type = "unit", name = "small-spitter", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Small_Spitter, order="b-d-a", subgroup="enemies", resistances = Resistances.Small_Spitter, healing_per_tick = 0.01, collision_box = {{-0.3, -0.3}, {0.3, 0.3}}, selection_box = {{-0.4, -0.4}, {0.4, 0.4}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = spitterattackparameters({range=15, cooldown=100, damage_modifier=1, scale=smallspitterscale, tint=smallspittertint, roarvolume=0.7}), vision_distance = 30, movement_speed = 0.185, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 200, corpse = "small-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.65), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(smallspitterscale, smallspittertint) }, --]] ---- New Small Spitter 1 { type = "unit", name = "small-spitter-Mk2", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Small_Spitter_Mk2, order="b-d-b", subgroup="enemies", resistances = Resistances.Small_Spitter_Mk2, healing_per_tick = 0.01, collision_box = {{-0.3, -0.3}, {0.3, 0.3}}, selection_box = {{-0.4, -0.4}, {0.4, 0.4}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Infected({range=14, cooldown=100, damage_modifier=1.1, scale=smallspitterMk2scale, tint=smallspitterMk2tint, roarvolume=0.7}), vision_distance = 30, movement_speed = 0.185, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 200, corpse = "small-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.65), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(smallspitterMk2scale, smallspitterMk2tint) }, ---- New Small Spitter 2 { type = "unit", name = "small-spitter-Mk3", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Small_Spitter_Mk3, order="b-d-c", subgroup="enemies", resistances = Resistances.Small_Spitter_Mk3, healing_per_tick = 0.01, collision_box = {{-0.3, -0.3}, {0.3, 0.3}}, selection_box = {{-0.4, -0.4}, {0.4, 0.4}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Mutated({range=13, cooldown=100, damage_modifier=1.2, scale=smallspitterMk3scale, tint=smallspitterMk3tint, roarvolume=0.7}), vision_distance = 30, movement_speed = 0.185, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 200, corpse = "small-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.65), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(smallspitterMk3scale, smallspitterMk3tint) }, ---- Vanilla Medium Spitter --[[ { type = "unit", name = "medium-spitter", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Medium_Spitter, order="b-d-d", subgroup="enemies", resistances = Resistances.Medium_Spitter, healing_per_tick = 0.015, collision_box = {{-0.4, -0.4}, {0.4, 0.4}}, selection_box = {{-0.5, -0.7}, {0.5, 0.7}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = spitterattackparameters({range=15, cooldown=100, damage_modifier=2, scale=mediumspitterscale, tint=mediumspittertint, roarvolume=0.85}), vision_distance = 30, movement_speed = 0.165, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 600, corpse = "medium-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.75), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(mediumspitterscale, mediumspittertint) }, --]] --- New Medium Spitter 1 { type = "unit", name = "medium-spitter-Mk2", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Medium_Spitter_Mk2, order="b-d-e", subgroup="enemies", resistances = Resistances.Medium_Spitter_Mk2, healing_per_tick = 0.015, collision_box = {{-0.4, -0.4}, {0.4, 0.4}}, selection_box = {{-0.5, -0.7}, {0.5, 0.7}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Infected({range=15, cooldown=100, damage_modifier=2.2, scale=mediumspitterMk2scale, tint=mediumspitterMk2tint, roarvolume=0.85}), vision_distance = 30, movement_speed = 0.165, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 600, corpse = "medium-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.75), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(mediumspitterMk2scale, mediumspitterMk2tint) }, --- New Medium Spitter 2 { type = "unit", name = "medium-spitter-Mk3", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Medium_Spitter_Mk3, order="b-d-f", subgroup="enemies", resistances = Resistances.Medium_Spitter_Mk3, healing_per_tick = 0.015, collision_box = {{-0.4, -0.4}, {0.4, 0.4}}, selection_box = {{-0.5, -0.7}, {0.5, 0.7}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Mutated({range=15, cooldown=100, damage_modifier=2.4, scale=mediumspitterMk3scale, tint=mediumspitterMk3tint, roarvolume=0.85}), vision_distance = 30, movement_speed = 0.165, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 600, corpse = "medium-spitter-corpse", dying_explosion = "blood-explosion-small", working_sound = make_biter_calls(0.75), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(mediumspitterMk3scale, mediumspitterMk3tint) }, --- Vanilla Big Spitter --[[ { type = "unit", name = "big-spitter", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Big_Spitter, order="b-d-g", subgroup="enemies", resistances = Resistances.Big_Spitter, spawning_time_modifier = 2, healing_per_tick = 0.02, collision_box = {{-0.5, -0.5}, {0.5, 0.5}}, selection_box = {{-0.7, -1.0}, {0.7, 1.0}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = spitterattackparameters({range=15, cooldown=100, damage_modifier=3, scale=bigspitterscale, tint=bigspittertint, roarvolume=0.95}), vision_distance = 30, movement_speed = 0.15, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 1500, corpse = "big-spitter-corpse", dying_explosion = "blood-explosion-big", working_sound = make_biter_calls(0.9), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(bigspitterscale, bigspittertint) }, --]] --- New Big Spitter 1 { type = "unit", name = "big-spitter-Mk2", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Big_Spitter_Mk2, order="b-d-h", subgroup="enemies", resistances = Resistances.Big_Spitter_Mk2, spawning_time_modifier = 2, healing_per_tick = 0.02, collision_box = {{-0.5, -0.5}, {0.5, 0.5}}, selection_box = {{-0.7, -1.0}, {0.7, 1.0}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Infected({range=15, cooldown=100, damage_modifier=3.3, scale=bigspitterMk2scale, tint=bigspitterMk2tint, roarvolume=0.95}), vision_distance = 30, movement_speed = 0.15, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 1200, corpse = "big-spitter-corpse", dying_explosion = "blood-explosion-big", working_sound = make_biter_calls(0.9), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(bigspitterMk2scale, bigspitterMk2tint) }, --- New Big Spitter 2 { type = "unit", name = "big-spitter-Mk3", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Big_Spitter_Mk3, order="b-d-i", subgroup="enemies", resistances = Resistances.Big_Spitter_Mk3, spawning_time_modifier = 2, healing_per_tick = 0.02, collision_box = {{-0.5, -0.5}, {0.5, 0.5}}, selection_box = {{-0.7, -1.0}, {0.7, 1.0}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = Spitter_Attack_Mutated({range=15, cooldown=100, damage_modifier=3.6, scale=bigspitterMk3scale, tint=bigspitterMk3tint, roarvolume=0.95}), vision_distance = 30, movement_speed = 0.15, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 1200, corpse = "big-spitter-corpse", dying_explosion = "blood-explosion-big", working_sound = make_biter_calls(0.9), dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(bigspitterMk3scale, bigspitterMk3tint) }, --- Vanilla Behemoth Spitter --[[ { type = "unit", name = "behemoth-spitter", icon = "__base__/graphics/icons/creeper.png", flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"}, max_health = Health.Behemoth_Spitter, order="b-d-j", subgroup="enemies", resistances = Resistances.Behemoth_Spitter, spawning_time_modifier = 8, healing_per_tick = 0.1, collision_box = {{-0.5, -0.5}, {0.5, 0.5}}, selection_box = {{-0.7, -1.0}, {0.7, 1.0}}, sticker_box = {{-0.3, -0.5}, {0.3, 0.1}}, distraction_cooldown = 300, attack_parameters = spitterattackparameters({range=15, cooldown=100, damage_modifier=5, scale=behemothspitterscale, tint=behemothspittertint}), vision_distance = 30, movement_speed = 0.15, distance_per_frame = 0.05, -- in pu pollution_to_join_attack = 10000, corpse = "behemoth-spitter-corpse", dying_explosion = "blood-explosion-big", dying_sound = make_spitter_dying_sounds(1.0), run_animation = spitterrunanimation(behemothspitterscale, behemothspittertint) }, --]] })
mit
Lsty/ygopro-scripts
c18865703.lua
3
3191
--ZW-玄武絶対聖盾 function c18865703.initial_effect(c) c:SetUniqueOnField(1,0,18865703) --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(18865703,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_MZONE) e1:SetCondition(c18865703.eqcon) e1:SetTarget(c18865703.eqtg) e1:SetOperation(c18865703.eqop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(18865703,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e2:SetTarget(c18865703.sptg) e2:SetOperation(c18865703.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end function c18865703.eqcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():CheckUniqueOnField(tp) end function c18865703.filter(c) return c:IsFaceup() and c:IsSetCard(0x7f) end function c18865703.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c18865703.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c18865703.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c18865703.filter,tp,LOCATION_MZONE,0,1,1,nil) end function c18865703.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c18865703.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_DEFENCE) e2:SetValue(2000) e2:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e2) end function c18865703.eqlimit(e,c) return c==e:GetLabelObject() end function c18865703.spfilter(c,e,tp) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c18865703.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c18865703.spfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(c18865703.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c18865703.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c18865703.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE) end end
gpl-2.0
MalRD/darkstar
scripts/globals/items/coral_butterfly.lua
11
1054
----------------------------------------- -- ID: 4580 -- Item: Coral Butterfly -- Food Effect: 5Min, Mithra only ----------------------------------------- -- Dexterity 2 -- Mind -4 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if (target:getRace() ~= dsp.race.MITHRA) then result = dsp.msg.basic.CANNOT_EAT end if (target:getMod(dsp.mod.EAT_RAW_FISH) == 1) then result = 0 end if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,300,4580) end function onEffectGain(target, effect) target:addMod(dsp.mod.DEX, 2) target:addMod(dsp.mod.MND, -4) end function onEffectLose(target, effect) target:delMod(dsp.mod.DEX, 2) target:delMod(dsp.mod.MND, -4) end
gpl-3.0
Lsty/ygopro-scripts
c47121070.lua
3
1674
--宝玉の双璧 function c47121070.initial_effect(c) --to field local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(c47121070.tfcon) e1:SetTarget(c47121070.tftg) e1:SetOperation(c47121070.tfop) c:RegisterEffect(e1) end function c47121070.filter(c,tp) return c:IsSetCard(0x1034) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp and c:IsReason(REASON_BATTLE) end function c47121070.tfcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c47121070.filter,1,nil,tp) end function c47121070.tftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x1034) end end function c47121070.tfop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x1034) if g:GetCount()>0 then local tc=g:GetFirst() Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) local e1=Effect.CreateEffect(tc) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) tc:RegisterEffect(e1) Duel.RaiseEvent(tc,47408488,e,0,tp,0,0) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetValue(1) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end
gpl-2.0
MalRD/darkstar
scripts/globals/weaponskills/wheeling_thrust.lua
10
1610
----------------------------------- -- Wheeling Thrust -- Polearm weapon skill -- Skill Level: 225 -- Ignores enemy's defense. Amount ignored varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Flame Gorget & Light Gorget. -- Aligned with the Flame Belt & Light Belt. -- Element: None -- Modifiers: STR:80% -- 100%TP 200%TP 300%TP -- 1.75 1.75 1.75 ----------------------------------- require("scripts/globals/status") require("scripts/globals/settings") require("scripts/globals/weaponskills") ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {} params.numHits = 1 params.ftp100 = 1.75 params.ftp200 = 1.75 params.ftp300 = 1.75 params.str_wsc = 0.5 params.dex_wsc = 0.0 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0 params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0 params.canCrit = false params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0 params.atk100 = 1; params.atk200 = 1; params.atk300 = 1; -- Defense ignored is 50%, 75%, 100% (50% at 100 TP is accurate, other values are guesses) params.ignoresDef = true params.ignored100 = 0.5 params.ignored200 = 0.75 params.ignored300 = 1 if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.str_wsc = 0.8 end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) return tpHits, extraHits, criticalHit, damage end
gpl-3.0
MalRD/darkstar
scripts/globals/spells/cura_iii.lua
12
4172
----------------------------------------- -- Spell: Cura III -- Restores hp in area of effect. Self target only -- From what I understand, Cura III's base potency is the same as Cure III's. -- With Afflatus Misery Bonus, it can be as potent as a Curaga IV -- Modeled after our cure_iii.lua, which was modeled after the below reference -- Shamelessly stolen from http://members.shaw.ca/pizza_steve/cure/Cure_Calculator.html ----------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/magic") require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) if (caster:getID() ~= target:getID()) then return dsp.msg.basic.CANNOT_PERFORM_TARG else return 0 end end function onSpellCast(caster,target,spell) local divisor = 0 local constant = 0 local basepower = 0 local power = 0 local basecure = 0 local final = 0 local minCure = 130 if (USE_OLD_CURE_FORMULA == true) then power = getCurePowerOld(caster) divisor = 1 constant = 70 if (power > 300) then divisor = 15.6666 constant = 180.43 elseif (power > 180) then divisor = 2 constant = 115 end else power = getCurePower(caster) if (power < 125) then divisor = 2.2 constant = 130 basepower = 70 elseif (power < 200) then divisor = 75/65 constant = 155 basepower = 125 elseif (power < 300) then divisor = 2.5 constant = 220 basepower = 200 elseif (power < 700) then divisor = 5 constant = 260 basepower = 300 else divisor = 999999 constant = 340 basepower = 0 end end if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else basecure = getBaseCure(power,divisor,constant,basepower) end --Apply Afflatus Misery Bonus to the Result if (caster:hasStatusEffect(dsp.effect.AFFLATUS_MISERY)) then if (caster:getID() == target:getID()) then -- Let's use a local var to hold the power of Misery so the boost is applied to all targets, caster:setLocalVar("Misery_Power", caster:getMod(dsp.mod.AFFLATUS_MISERY)) end local misery = caster:getLocalVar("Misery_Power") --THIS IS LARELY SEMI-EDUCATED GUESSWORK. THERE IS NOT A --LOT OF CONCRETE INFO OUT THERE ON CURA THAT I COULD FIND --Not very much documentation for Cura II known at all. --As with Cura, the Afflatus Misery bonus can boost this spell up --to roughly the level of a Curaga 4. For Cura II vs Curaga III, --this is document at ~375HP, 15HP less than the cap of 390HP. So --for Cura II, i'll go with 15 less than the cap of Curaga IV (690): 675 --So with lack of available formula documentation, I'll go with that. --printf("BEFORE AFFLATUS MISERY BONUS: %d", basecure) basecure = basecure + misery if (basecure > 675) then basecure = 675 end --printf("AFTER AFFLATUS MISERY BONUS: %d", basecure) --Afflatus Misery Mod Gets Used Up caster:setMod(dsp.mod.AFFLATUS_MISERY, 0) end final = getCureFinal(caster,spell,basecure,minCure,false) final = final + (final * (target:getMod(dsp.mod.CURE_POTENCY_RCVD)/100)) --Applying server mods.... final = final * CURE_POWER local diff = (target:getMaxHP() - target:getHP()) if (final > diff) then final = diff end target:addHP(final) target:wakeUp() --Enmity for Cura III is fixed, so its CE/VE is set in the SQL and not calculated with updateEnmityFromCure spell:setMsg(dsp.msg.basic.AOE_HP_RECOVERY) local mpBonusPercent = (final*caster:getMod(dsp.mod.CURE2MP_PERCENT))/100 if (mpBonusPercent > 0) then caster:addMP(mpBonusPercent) end return final end
gpl-3.0
Lsty/ygopro-scripts
c32933942.lua
3
1563
--宝玉獣 アメジスト・キャット function c32933942.initial_effect(c) --send replace local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCondition(c32933942.repcon) e1:SetOperation(c32933942.repop) c:RegisterEffect(e1) --direct attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e2) --damage reduce local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetCondition(c32933942.rdcon) e3:SetOperation(c32933942.rdop) c:RegisterEffect(e3) end function c32933942.repcon(e) local c=e:GetHandler() return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) end function c32933942.repop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) c:RegisterEffect(e1) Duel.RaiseEvent(c,47408488,e,0,tp,0,0) end function c32933942.rdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return ep~=tp and c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end function c32933942.rdop(e,tp,eg,ep,ev,re,r,rp) Duel.ChangeBattleDamage(ep,ev/2) end
gpl-2.0
MalRD/darkstar
scripts/globals/items/serving_of_green_curry.lua
11
1582
----------------------------------------- -- ID: 4296 -- Item: serving_of_green_curry -- Food Effect: 180Min, All Races ----------------------------------------- -- Agility 2 -- Vitality 1 -- Health Regen While Healing 2 -- Magic Regen While Healing 1 -- Defense +9% (cap 160) -- Ranged ACC +5% (cap 25) -- Sleep Resist +3 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,10800,4296) end function onEffectGain(target, effect) target:addMod(dsp.mod.AGI, 2) target:addMod(dsp.mod.VIT, 1) target:addMod(dsp.mod.HPHEAL, 2) target:addMod(dsp.mod.MPHEAL, 1) target:addMod(dsp.mod.FOOD_DEFP, 9) target:addMod(dsp.mod.FOOD_DEF_CAP, 160) target:addMod(dsp.mod.FOOD_RACCP, 5) target:addMod(dsp.mod.FOOD_RACC_CAP, 25) target:addMod(dsp.mod.SLEEPRES, 3) end function onEffectLose(target, effect) target:delMod(dsp.mod.AGI, 2) target:delMod(dsp.mod.VIT, 1) target:delMod(dsp.mod.HPHEAL, 2) target:delMod(dsp.mod.MPHEAL, 1) target:delMod(dsp.mod.FOOD_DEFP, 9) target:delMod(dsp.mod.FOOD_DEF_CAP, 160) target:delMod(dsp.mod.FOOD_RACCP, 5) target:delMod(dsp.mod.FOOD_RACC_CAP, 25) target:delMod(dsp.mod.SLEEPRES, 3) end
gpl-3.0
Frenzie/koreader
frontend/ui/widget/buttonprogresswidget.lua
4
10346
local Blitbuffer = require("ffi/blitbuffer") local Button = require("ui/widget/button") local Device = require("device") local FocusManager = require("ui/widget/focusmanager") local Geom = require("ui/geometry") local HorizontalGroup = require("ui/widget/horizontalgroup") local HorizontalSpan = require("ui/widget/horizontalspan") local FrameContainer = require("ui/widget/container/framecontainer") local Size = require("ui/size") local UIManager = require("ui/uimanager") local _ = require("gettext") local Screen = Device.screen local ButtonProgressWidget = FocusManager:extend{ width = Screen:scaleBySize(216), height = Size.item.height_default, padding = Size.padding.small, font_face = "cfont", font_size = 16, enabled = true, num_buttons = 2, position = 1, default_position = nil, thin_grey_style = false, -- default to black fine_tune = false, -- no -/+ buttons on the extremities by default more_options = false, -- no "⋮" button } function ButtonProgressWidget:init() self.current_button_index = self.position self.buttonprogress_frame = FrameContainer:new{ background = Blitbuffer.COLOR_WHITE, color = Blitbuffer.COLOR_DARK_GRAY, radius = Size.radius.window, bordersize = 0, padding = self.padding, dim = not self.enabled, } self.buttonprogress_content = HorizontalGroup:new{} self.horizontal_span_width = 0 if self.fine_tune or self.more_options then self.horizontal_span = HorizontalSpan:new{ width = Size.margin.fine_tune } self.horizontal_span_width = self.horizontal_span.width end self:update() if self.fine_tune then self.current_button_index = self.current_button_index + 1 end self.buttonprogress_frame[1] = self.buttonprogress_content self[1] = self.buttonprogress_frame self.dimen = Geom:new(self.buttonprogress_frame:getSize()) end function ButtonProgressWidget:update() self.layout = {{}} self.buttonprogress_content:clear() local button_margin = Size.margin.tiny local button_padding = Size.padding.button local button_bordersize = self.thin_grey_style and Size.border.thin or Size.border.button local buttons_count = self.num_buttons local span_count = 0 if self.fine_tune then buttons_count = buttons_count + 2 span_count = 2 end if self.more_options then buttons_count = buttons_count + 1 span_count = span_count + 1 end local button_width_real = (self.width - span_count * self.horizontal_span_width) / buttons_count - 2*button_padding - 2*button_margin - 2*button_bordersize local button_width = math.floor(button_width_real) local button_width_adjust = button_width_real - button_width local button_width_to_add = 0 -- Minus button on the left if self.fine_tune then button_width_to_add = button_width_to_add + button_width_adjust local margin = button_margin local extra_border_size = 0 local button = Button:new{ text = "−", radius = 0, margin = margin, padding = button_padding, bordersize = button_bordersize + extra_border_size, enabled = true, width = button_width - 2*extra_border_size, preselect = false, text_font_face = self.font_face, text_font_size = self.font_size, callback = function() self.callback("-") self:update() end, hold_callback = self.hold_callback and function() self.hold_callback("-") end, } if self.thin_grey_style then button.frame.color = Blitbuffer.COLOR_DARK_GRAY end table.insert(self.buttonprogress_content, button) table.insert(self.layout[1], button) table.insert(self.buttonprogress_content, self.horizontal_span) end -- Actual progress bar for i = 1, self.num_buttons do button_width_to_add = button_width_to_add + button_width_adjust local real_button_width = button_width if button_width_to_add >= 1 then -- One pixel wider to better align the entire widget real_button_width = button_width + math.floor(button_width_to_add) button_width_to_add = button_width_to_add - math.floor(button_width_to_add) end local highlighted = i <= self.position local is_default = i == self.default_position local margin = button_margin if self.thin_grey_style and highlighted then margin = 0 -- moved outside button so it's not inverted end local extra_border_size = 0 if not self.thin_grey_style and is_default then -- make the border a bit bigger on the default button extra_border_size = Size.border.thin end local button = Button:new{ text = "", radius = 0, margin = margin, padding = button_padding, bordersize = button_bordersize + extra_border_size, enabled = true, width = real_button_width - 2*extra_border_size, preselect = highlighted, text_font_face = self.font_face, text_font_size = self.font_size, callback = function() self.callback(i) self.position = i self:update() end, no_focus = highlighted, hold_callback = self.hold_callback and function() self.hold_callback(i) end, } if self.thin_grey_style then if is_default then -- use a black border as a discreet visual hint button.frame.color = Blitbuffer.COLOR_BLACK else -- otherwise, gray border, same as the filled -- button, so looking as if no border button.frame.color = Blitbuffer.COLOR_DARK_GRAY end if highlighted then -- The button and its frame background will be inverted, -- so invert the color we want so it gets inverted back button.frame.background = Blitbuffer.COLOR_DARK_GRAY:invert() button = FrameContainer:new{ -- add margin back margin = button_margin, padding = 0, bordersize = 0, focusable = true, focus_border_size = Size.border.thin, button, } end end table.insert(self.buttonprogress_content, button) table.insert(self.layout[1], button) end -- Plus button on the right if self.fine_tune then button_width_to_add = button_width_to_add + button_width_adjust local real_button_width = button_width if button_width_to_add >= 1 then -- One pixel wider to better align the entire widget real_button_width = button_width + math.floor(button_width_to_add) button_width_to_add = button_width_to_add - math.floor(button_width_to_add) end local margin = button_margin local extra_border_size = 0 local button = Button:new{ text = "+", radius = 0, margin = margin, padding = button_padding, bordersize = button_bordersize + extra_border_size, enabled = true, width = real_button_width - 2*extra_border_size, preselect = false, text_font_face = self.font_face, text_font_size = self.font_size, callback = function() self.callback("+") self:update() end, hold_callback = self.hold_callback and function() self.hold_callback("+") end, } if self.thin_grey_style then button.frame.color = Blitbuffer.COLOR_DARK_GRAY end table.insert(self.buttonprogress_content, self.horizontal_span) table.insert(self.buttonprogress_content, button) table.insert(self.layout[1], button) end -- More option button on the right if self.more_options then button_width_to_add = button_width_to_add + button_width_adjust local real_button_width = button_width if button_width_to_add >= 1 then -- One pixel wider to better align the entire widget real_button_width = button_width + math.floor(button_width_to_add) end local margin = button_margin local extra_border_size = 0 local button = Button:new{ text = "⋮", radius = 0, margin = margin, padding = button_padding, bordersize = button_bordersize + extra_border_size, enabled = true, width = real_button_width - 2*extra_border_size, preselect = false, text_font_face = self.font_face, text_font_size = self.font_size, callback = function() self.callback("⋮") self:update() end, hold_callback = self.hold_callback and function() self.hold_callback("⋮") end, } if self.thin_grey_style then button.frame.color = Blitbuffer.COLOR_DARK_GRAY end table.insert(self.buttonprogress_content, self.horizontal_span) table.insert(self.buttonprogress_content, button) table.insert(self.layout[1], button) end self:refocusWidget() UIManager:setDirty(self.show_parent, function() return "ui", self.dimen end) end function ButtonProgressWidget:setPosition(position, default_position) self.position = position self.default_position = default_position self:update() end function ButtonProgressWidget:onTapSelect(arg, gev) if gev == nil then self:circlePosition() end end function ButtonProgressWidget:circlePosition() if self.position then self.position = self.position+1 if self.position > self.num_buttons then self.position = 1 end self.callback(self.position) self:update() end end return ButtonProgressWidget
agpl-3.0
morfeo642/mta_plr_server
module/util/groupids.lua
1
6817
--[[! \file \brief Es un módulo que permite crear grupos de ids y comprobar si una id está en alguno de estos grupos. Los grupos pueden agruparse paara formar grupos más complejos, con operadores de negación y or. ]] loadModule("util/class"); loadModule("util/math/range"); loadModule("util/assertutils"); loadModule("util/checkutils"); loadModule("util/stringutils"); loadModule("util/tableutils"); --[[! Esta clase representa un conjunto de IDs arbitrarias. ]] groupIds = class(); --[[! Inicializador. @param ... Es un conjunto de rangos de ids e ids que compondrán al grupo inicialmente. @note Si se indican tablas como argumentos deberán ser instancias de la clase range. Por el contrario, deben ser números. ]] function groupIds:init(...) self.ranges = {}; for _, ids in ipairs({...}) do if type(ids) == "table" then self:addRangeIds(ids); else self:addId(ids); end; end; end; --[[! @return Devuelve una copia de este grupo de IDs ]] function groupIds:clone() local aux = {}; aux.ranges = table.shallow_copy(self.ranges); return setmetatable(aux, groupIds); end; --[[! Convierte una cadena de caracteres en un grupo de IDs. @param str Es la cadena de caracteres donde se especifican las IDs o bien rangos de IDs separados por comas o por punto y coma @param symbols Por defecto es una tabla vacía. Es una tabla con grupos de IDs. Los índices son símbolos representativos de estos grupos (pueden especificarse en la cadena de caracteres a analizar y serán interpretados como el grupo de IDs que representan) y los valores son los grupos de IDs. \code local group = groupIds.fromString("3, 4, 5,3,10,20,30, 70-80, -1); \endcode ]] function groupIds.fromString(str, symbols) -- tokenizar la cadena de caracteres. local tokens = {}; for token in wpairs(str, ",; ") do tokens[#tokens+1] = token; end; local group = groupIds(); -- analizar cada token for _, token in ipairs(tokens) do if token:match("%d+-%d+") then local lowerBound, upperBound = token:match("(%d+)-(%d+)"); lowerBound, upperBound = tonumber(lowerBound), tonumber(upperBound); group:addRangeIds(range(lowerBound, upperBound)); elseif token:match("%d+") then local id = tonumber(token:match("(%d+)")); group:addId(id); else localizedAssert(symbols and symbols[token], "Failed to parse group IDs; " .. token .. " is not a valid ID or group of IDs", 2); group = group + symbols[token]; end; end; return group; end; --[[! Añade un rango de IDs al conjunto. ]] function groupIds:addRangeIds(rangeIds) if #self.ranges > 0 then -- buscar el primer rango que interseccione con el nuevo rango. local i = 1; while (i < #self.ranges) and (not rangeIds:intersectsWith(self.ranges[i]:translate(1, 1))) do i = i + 1; end; if rangeIds:intersectsWith(self.ranges[i]:translate(1, 1)) then if i < #self.ranges then -- buscar el primer rango después del rango i que no intersecciona -- con el nuevo rango. local j = i; while ((j+1) < #self.ranges) and rangeIds:intersectsWith(self.ranges[j+1]:translate(1, 1)) do j = j + 1; end; if not rangeIds:intersectsWith(self.ranges[j+1]:translate(1, 1)) then -- Reemplazamos rangos desde el i+1ésimo hasta el jésimo por un -- nuevo rango. local aux = rangeIds:getWrapper(self.ranges[i]):getWrapper(self.ranges[j]); for k=j,i+1,-1 do table.remove(self.ranges, k); end; self.ranges[i] = aux; else -- no hay ningún rango después del rango iésimo que no -- interseccione con el nuevo rango. local aux = rangeIds:getWrapper(self.ranges[i]):getWrapper(self.ranges[#self.ranges]); -- eliminamos todos los rangos a partir del iesimo. for k=j+1,i+1,-1 do table.remove(self.ranges, k); end; -- insertamos el nuevo rango.. self.ranges[i] = aux; end; else local aux = self.ranges[i]; self.ranges[i] = rangeIds:getWrapper(aux); end; else -- no intersecciona con ningún rango, insertar el nuevo rango -- después del rango cuyo límite superior es inferior al límite -- inferior del nuevo rango... -- buscar ese rango... if #self.ranges > 1 then if rangeIds:getUpperBound() < self.ranges[1]:getLowerBound() then -- añadir al principio. table.insert(self.ranges, 1, rangeIds); else i = 1; while ((i+1) < #self.ranges) and (rangeIds:getUpperBound() > self.ranges[i+1]:getLowerBound()) do i = i + 1; end; if rangeIds:getUpperBound() < self.ranges[i+1]:getLowerBound() then table.insert(self.ranges, i+1, rangeIds); else table.insert(self.ranges, rangeIds); end; end; else if rangeIds:getUpperBound() < self.ranges[1]:getLowerBound() then table.insert(self.ranges, 1, rangeIds); else table.insert(self.ranges, rangeIds); end; end; end; else table.insert(self.ranges, rangeIds); end; end; --[[! Añade una id al conjunto. ]] function groupIds:addId(id) self:addRangeIds(range(id, id)); end; --[[! @return Devuelve todas las IDs que pertenecen a este grupo en una tabla. @note Las IDs están situadas en la tabla de forma creciente. ]] function groupIds:getAllIds() local aux = {}; for _,r in ipairs(self.ranges) do for i=r:getLowerBound(),r:getUpperBound(),1 do aux[#aux+1] = i; end; end; return aux; end; --[[! @return Devuelve un valor booleano indicando si una ID está en este conjunto o no. ]] function groupIds:isInside(x) if #self.ranges > 0 then if #self.ranges > 1 then -- buscar el rango previo al rango cuyo límite inferior es -- superior al valor. if self.ranges[1]:getLowerBound() > x then return false; end; local i = 1; while ((i+1) < #self.ranges) and (x >= self.ranges[i+1]:getLowerBound()) do i = i + 1; end; if x < self.ranges[i+1]:getLowerBound() then return x <= self.ranges[i]:getUpperBound(); else return x <= self.ranges[i+1]:getUpperBound(); end; end; return self.ranges[1]:isInside(x); end; return false; end; --[[! @return Devuelve not self:isInside(x) ]] function groupIds:isOutside(x) return not self:isInside(x); end; --[[! Es un alias de groupIds.isInside ]] groupIds.has = groupIds.isInside; --[[! @return Devuelve un conjunto de IDs que contiene las IDs de dos conjuntos. (Operación or) ]] function groupIds.__add(a, b) local aux = a:clone(); for _, range in ipairs(b.ranges) do aux:addRangeIds(range); end; return aux; end; --[[! @return Devuelve una representación en forma de cadena de caracteres de este grupo. ]] function groupIds.__tostring(g) return "[" .. table.concat(g:getAllIds(), ",") .. "]"; end; -- Es un grupo que no contiene ninguna ID groupIds.empty = groupIds();
mit
tofurama3000/The-Obscurity-Project
cocos2d/plugin/luabindings/auto/api/AgentManager.lua
146
1798
-------------------------------- -- @module AgentManager -- @parent_module plugin -------------------------------- -- -- @function [parent=#AgentManager] getSocialPlugin -- @param self -- @return plugin::ProtocolSocial#plugin::ProtocolSocial ret (return value: cc.plugin::ProtocolSocial) -------------------------------- -- -- @function [parent=#AgentManager] getAdsPlugin -- @param self -- @return plugin::ProtocolAds#plugin::ProtocolAds ret (return value: cc.plugin::ProtocolAds) -------------------------------- -- -- @function [parent=#AgentManager] purge -- @param self -------------------------------- -- -- @function [parent=#AgentManager] getUserPlugin -- @param self -- @return plugin::ProtocolUser#plugin::ProtocolUser ret (return value: cc.plugin::ProtocolUser) -------------------------------- -- -- @function [parent=#AgentManager] getIAPPlugin -- @param self -- @return plugin::ProtocolIAP#plugin::ProtocolIAP ret (return value: cc.plugin::ProtocolIAP) -------------------------------- -- -- @function [parent=#AgentManager] getSharePlugin -- @param self -- @return plugin::ProtocolShare#plugin::ProtocolShare ret (return value: cc.plugin::ProtocolShare) -------------------------------- -- -- @function [parent=#AgentManager] getAnalyticsPlugin -- @param self -- @return plugin::ProtocolAnalytics#plugin::ProtocolAnalytics ret (return value: cc.plugin::ProtocolAnalytics) -------------------------------- -- -- @function [parent=#AgentManager] destroyInstance -- @param self -------------------------------- -- -- @function [parent=#AgentManager] getInstance -- @param self -- @return plugin::AgentManager#plugin::AgentManager ret (return value: cc.plugin::AgentManager) return nil
mit
ThingMesh/openwrt-luci
applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
11
17421
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2010 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- require("luci.tools.webadmin") local fs = require "nixio.fs" local util = require "luci.util" local ip = require "luci.ip" local has_ipip = fs.glob("/etc/modules.d/[0-9]*-ipip")() m = Map("olsrd", translate("OLSR Daemon"), translate("The OLSR daemon is an implementation of the Optimized Link State Routing protocol. ".. "As such it allows mesh routing for any network equipment. ".. "It runs on any wifi card that supports ad-hoc mode and of course on any ethernet device. ".. "Visit <a href='http://www.olsr.org'>olsrd.org</a> for help and documentation.")) function m.on_parse() local has_defaults = false m.uci:foreach("olsrd", "InterfaceDefaults", function(s) has_defaults = true return false end) if not has_defaults then m.uci:section("olsrd", "InterfaceDefaults") end end function write_float(self, section, value) local n = tonumber(value) if n ~= nil then return Value.write(self, section, "%.1f" % n) end end s = m:section(TypedSection, "olsrd", translate("General settings")) s.anonymous = true s:tab("general", translate("General Settings")) s:tab("lquality", translate("Link Quality Settings")) s:tab("smartgw", translate("SmartGW"), not has_ipip and translate("Warning: kmod-ipip is not installed. Without kmod-ipip SmartGateway will not work, please install it.")) s:tab("advanced", translate("Advanced Settings")) ipv = s:taboption("general", ListValue, "IpVersion", translate("Internet protocol"), translate("IP-version to use. If 6and4 is selected then one olsrd instance is started for each protocol.")) ipv:value("4", "IPv4") ipv:value("6", "IPv6") ipv:value("6and4", "6and4") poll = s:taboption("advanced", Value, "Pollrate", translate("Pollrate"), translate("Polling rate for OLSR sockets in seconds. Default is 0.05.")) poll.optional = true poll.datatype = "ufloat" poll.placeholder = "0.05" nicc = s:taboption("advanced", Value, "NicChgsPollInt", translate("Nic changes poll interval"), translate("Interval to poll network interfaces for configuration changes (in seconds). Default is \"2.5\".")) nicc.optional = true nicc.datatype = "ufloat" nicc.placeholder = "2.5" tos = s:taboption("advanced", Value, "TosValue", translate("TOS value"), translate("Type of service value for the IP header of control traffic. Default is \"16\".")) tos.optional = true tos.datatype = "uinteger" tos.placeholder = "16" fib = s:taboption("general", ListValue, "FIBMetric", translate("FIB metric"), translate ("FIBMetric controls the metric value of the host-routes OLSRd sets. ".. "\"flat\" means that the metric value is always 2. This is the preferred value ".. "because it helps the linux kernel routing to clean up older routes. ".. "\"correct\" uses the hopcount as the metric value. ".. "\"approx\" use the hopcount as the metric value too, but does only update the hopcount if the nexthop changes too. ".. "Default is \"flat\".")) fib:value("flat") fib:value("correct") fib:value("approx") lql = s:taboption("lquality", ListValue, "LinkQualityLevel", translate("LQ level"), translate("Link quality level switch between hopcount and cost-based (mostly ETX) routing.<br />".. "<b>0</b> = do not use link quality<br />".. "<b>2</b> = use link quality for MPR selection and routing<br />".. "Default is \"2\"")) lql:value("2") lql:value("0") lqage = s:taboption("lquality", Value, "LinkQualityAging", translate("LQ aging"), translate("Link quality aging factor (only for lq level 2). Tuning parameter for etx_float and etx_fpm, smaller values ".. "mean slower changes of ETX value. (allowed values are between 0.01 and 1.0)")) lqage.optional = true lqage:depends("LinkQualityLevel", "2") lqa = s:taboption("lquality", ListValue, "LinkQualityAlgorithm", translate("LQ algorithm"), translate("Link quality algorithm (only for lq level 2).<br />".. "<b>etx_float</b>: floating point ETX with exponential aging<br />".. "<b>etx_fpm</b> : same as etx_float, but with integer arithmetic<br />".. "<b>etx_ff</b> : ETX freifunk, an etx variant which use all OLSR traffic (instead of only hellos) for ETX calculation<br />".. "<b>etx_ffeth</b>: incompatible variant of etx_ff that allows ethernet links with ETX 0.1.<br />".. "Defaults to \"etx_ff\"")) lqa.optional = true lqa:value("etx_ff") lqa:value("etx_fpm") lqa:value("etx_float") lqa:value("etx_ffeth") lqa:depends("LinkQualityLevel", "2") lqa.optional = true lqfish = s:taboption("lquality", Flag, "LinkQualityFishEye", translate("LQ fisheye"), translate("Fisheye mechanism for TCs (checked means on). Default is \"on\"")) lqfish.default = "1" lqfish.optional = true hyst = s:taboption("lquality", Flag, "UseHysteresis", translate("Use hysteresis"), translate("Hysteresis for link sensing (only for hopcount metric). Hysteresis adds more robustness to the link sensing ".. "but delays neighbor registration. Defaults is \"yes\"")) hyst.default = "yes" hyst.enabled = "yes" hyst.disabled = "no" hyst:depends("LinkQualityLevel", "0") hyst.optional = true hyst.rmempty = true port = s:taboption("general", Value, "OlsrPort", translate("Port"), translate("The port OLSR uses. This should usually stay at the IANA assigned port 698. It can have a value between 1 and 65535.")) port.optional = true port.default = "698" port.rmempty = true mainip = s:taboption("general", Value, "MainIp", translate("Main IP"), translate("Sets the main IP (originator ip) of the router. This IP will NEVER change during the uptime of olsrd. ".. "Default is 0.0.0.0, which triggers usage of the IP of the first interface.")) mainip.optional = true mainip.rmempty = true mainip.datatype = "ipaddr" mainip.placeholder = "0.0.0.0" sgw = s:taboption("smartgw", Flag, "SmartGateway", translate("Enable"), translate("Enable SmartGateway. If it is disabled, then " .. "all other SmartGateway parameters are ignored. Default is \"no\".")) sgw.default="no" sgw.enabled="yes" sgw.disabled="no" sgw.rmempty = true sgwnat = s:taboption("smartgw", Flag, "SmartGatewayAllowNAT", translate("Allow gateways with NAT"), translate("Allow the selection of an outgoing ipv4 gateway with NAT")) sgwnat:depends("SmartGateway", "yes") sgwnat.default="yes" sgwnat.enabled="yes" sgwnat.disabled="no" sgwnat.optional = true sgwnat.rmempty = true sgwuplink = s:taboption("smartgw", ListValue, "SmartGatewayUplink", translate("Announce uplink"), translate("Which kind of uplink is exported to the other mesh nodes. " .. "An uplink is detected by looking for a local HNA of 0.0.0.0/0, ::ffff:0:0/96 or 2000::/3. Default setting is \"both\".")) sgwuplink:value("none") sgwuplink:value("ipv4") sgwuplink:value("ipv6") sgwuplink:value("both") sgwuplink:depends("SmartGateway", "yes") sgwuplink.default="both" sgwuplink.optional = true sgwuplink.rmempty = true sgwulnat = s:taboption("smartgw", Flag, "SmartGatewayUplinkNAT", translate("Uplink uses NAT"), translate("If this Node uses NAT for connections to the internet. " .. "Default is \"yes\".")) sgwulnat:depends("SmartGatewayUplink", "ipv4") sgwulnat:depends("SmartGatewayUplink", "both") sgwulnat.default="yes" sgwulnat.enabled="yes" sgwulnat.disabled="no" sgwnat.optional = true sgwnat.rmempty = true sgwspeed = s:taboption("smartgw", Value, "SmartGatewaySpeed", translate("Speed of the uplink"), translate("Specifies the speed of ".. "the uplink in kilobits/s. First parameter is upstream, second parameter is downstream. Default is \"128 1024\".")) sgwspeed:depends("SmartGatewayUplink", "ipv4") sgwspeed:depends("SmartGatewayUplink", "ipv6") sgwspeed:depends("SmartGatewayUplink", "both") sgwspeed.optional = true sgwspeed.rmempty = true sgwprefix = s:taboption("smartgw", Value, "SmartGatewayPrefix", translate("IPv6-Prefix of the uplink"), translate("This can be used " .. "to signal the external IPv6 prefix of the uplink to the clients. This might allow a client to change it's local IPv6 address to " .. "use the IPv6 gateway without any kind of address translation. The maximum prefix length is 64 bits. " .. "Default is \"::/0\" (no prefix).")) sgwprefix:depends("SmartGatewayUplink", "ipv6") sgwprefix:depends("SmartGatewayUplink", "both") sgwprefix.optional = true sgwprefix.rmempty = true willingness = s:taboption("advanced", ListValue, "Willingness", translate("Willingness"), translate("The fixed willingness to use. If not set willingness will be calculated dynamically based on battery/power status. Default is \"3\".")) for i=0,7 do willingness:value(i) end willingness.optional = true willingness.default = "3" natthr = s:taboption("advanced", Value, "NatThreshold", translate("NAT threshold"), translate("If the route to the current gateway is to be changed, the ETX value of this gateway is ".. "multiplied with this value before it is compared to the new one. ".. "The parameter can be a value between 0.1 and 1.0, but should be close to 1.0 if changed.<br />".. "<b>WARNING:</b> This parameter should not be used together with the etx_ffeth metric!<br />".. "Defaults to \"1.0\".")) for i=1,0.1,-0.1 do natthr:value(i) end natthr:depends("LinkQualityAlgorithm", "etx_ff") natthr:depends("LinkQualityAlgorithm", "etx_float") natthr:depends("LinkQualityAlgorithm", "etx_fpm") natthr.default = "1.0" natthr.optional = true natthr.write = write_float i = m:section(TypedSection, "InterfaceDefaults", translate("Interfaces Defaults")) i.anonymous = true i.addremove = false i:tab("general", translate("General Settings")) i:tab("addrs", translate("IP Addresses")) i:tab("timing", translate("Timing and Validity")) mode = i:taboption("general", ListValue, "Mode", translate("Mode"), translate("Interface Mode is used to prevent unnecessary packet forwarding on switched ethernet interfaces. ".. "valid Modes are \"mesh\" and \"ether\". Default is \"mesh\".")) mode:value("mesh") mode:value("ether") mode.optional = true mode.rmempty = true weight = i:taboption("general", Value, "Weight", translate("Weight"), translate("When multiple links exist between hosts the weight of interface is used to determine the link to use. ".. "Normally the weight is automatically calculated by olsrd based on the characteristics of the interface, ".. "but here you can specify a fixed value. Olsrd will choose links with the lowest value.<br />".. "<b>Note:</b> Interface weight is used only when LinkQualityLevel is set to 0. ".. "For any other value of LinkQualityLevel, the interface ETX value is used instead.")) weight.optional = true weight.datatype = "uinteger" weight.placeholder = "0" lqmult = i:taboption("general", DynamicList, "LinkQualityMult", translate("LinkQuality Multiplicator"), translate("Multiply routes with the factor given here. Allowed values are between 0.01 and 1.0. ".. "It is only used when LQ-Level is greater than 0. Examples:<br />".. "reduce LQ to 192.168.0.1 by half: 192.168.0.1 0.5<br />".. "reduce LQ to all nodes on this interface by 20%: default 0.8")) lqmult.optional = true lqmult.rmempty = true lqmult.cast = "table" lqmult.placeholder = "default 1.0" function lqmult.validate(self, value) for _, v in pairs(value) do if v ~= "" then local val = util.split(v, " ") local host = val[1] local mult = val[2] if not host or not mult then return nil, translate("LQMult requires two values (IP address or 'default' and multiplicator) seperated by space.") end if not (host == "default" or ip.IPv4(host) or ip.IPv6(host)) then return nil, translate("Can only be a valid IPv4 or IPv6 address or 'default'") end if not tonumber(mult) or tonumber(mult) > 1 or tonumber(mult) < 0.01 then return nil, translate("Invalid Value for LQMult-Value. Must be between 0.01 and 1.0.") end if not mult:match("[0-1]%.[0-9]+") then return nil, translate("Invalid Value for LQMult-Value. You must use a decimal number between 0.01 and 1.0 here.") end end end return value end ip4b = i:taboption("addrs", Value, "Ip4Broadcast", translate("IPv4 broadcast"), translate("IPv4 broadcast address for outgoing OLSR packets. One useful example would be 255.255.255.255. ".. "Default is \"0.0.0.0\", which triggers the usage of the interface broadcast IP.")) ip4b.optional = true ip4b.datatype = "ip4addr" ip4b.placeholder = "0.0.0.0" ip6m = i:taboption("addrs", Value, "IPv6Multicast", translate("IPv6 multicast"), translate("IPv6 multicast address. Default is \"FF02::6D\", the manet-router linklocal multicast.")) ip6m.optional = true ip6m.datatype = "ip6addr" ip6m.placeholder = "FF02::6D" ip4s = i:taboption("addrs", Value, "IPv4Src", translate("IPv4 source"), translate("IPv4 src address for outgoing OLSR packages. Default is \"0.0.0.0\", which triggers usage of the interface IP.")) ip4s.optional = true ip4s.datatype = "ip4addr" ip4s.placeholder = "0.0.0.0" ip6s = i:taboption("addrs", Value, "IPv6Src", translate("IPv6 source"), translate("IPv6 src prefix. OLSRd will choose one of the interface IPs which matches the prefix of this parameter. ".. "Default is \"0::/0\", which triggers the usage of a not-linklocal interface IP.")) ip6s.optional = true ip6s.datatype = "ip6addr" ip6s.placeholder = "0::/0" hi = i:taboption("timing", Value, "HelloInterval", translate("Hello interval")) hi.optional = true hi.datatype = "ufloat" hi.placeholder = "5.0" hi.write = write_float hv = i:taboption("timing", Value, "HelloValidityTime", translate("Hello validity time")) hv.optional = true hv.datatype = "ufloat" hv.placeholder = "40.0" hv.write = write_float ti = i:taboption("timing", Value, "TcInterval", translate("TC interval")) ti.optional = true ti.datatype = "ufloat" ti.placeholder = "2.0" ti.write = write_float tv = i:taboption("timing", Value, "TcValidityTime", translate("TC validity time")) tv.optional = true tv.datatype = "ufloat" tv.placeholder = "256.0" tv.write = write_float mi = i:taboption("timing", Value, "MidInterval", translate("MID interval")) mi.optional = true mi.datatype = "ufloat" mi.placeholder = "18.0" mi.write = write_float mv = i:taboption("timing", Value, "MidValidityTime", translate("MID validity time")) mv.optional = true mv.datatype = "ufloat" mv.placeholder = "324.0" mv.write = write_float ai = i:taboption("timing", Value, "HnaInterval", translate("HNA interval")) ai.optional = true ai.datatype = "ufloat" ai.placeholder = "18.0" ai.write = write_float av = i:taboption("timing", Value, "HnaValidityTime", translate("HNA validity time")) av.optional = true av.datatype = "ufloat" av.placeholder = "108.0" av.write = write_float ifs = m:section(TypedSection, "Interface", translate("Interfaces")) ifs.addremove = true ifs.anonymous = true ifs.extedit = luci.dispatcher.build_url("admin/services/olsrd/iface/%s") ifs.template = "cbi/tblsection" function ifs.create(...) local sid = TypedSection.create(...) luci.http.redirect(ifs.extedit % sid) end ign = ifs:option(Flag, "ignore", translate("Enable")) ign.enabled = "0" ign.disabled = "1" ign.rmempty = false function ign.cfgvalue(self, section) return Flag.cfgvalue(self, section) or "0" end network = ifs:option(DummyValue, "interface", translate("Network")) network.template = "cbi/network_netinfo" mode = ifs:option(DummyValue, "Mode", translate("Mode")) function mode.cfgvalue(...) return Value.cfgvalue(...) or m.uci:get_first("olsrd", "InterfaceDefaults", "Mode", "mesh") end hello = ifs:option(DummyValue, "_hello", translate("Hello")) function hello.cfgvalue(self, section) local i = tonumber(m.uci:get("olsrd", section, "HelloInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HelloInterval", 5)) local v = tonumber(m.uci:get("olsrd", section, "HelloValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HelloValidityTime", 40)) return "%.01fs / %.01fs" %{ i, v } end tc = ifs:option(DummyValue, "_tc", translate("TC")) function tc.cfgvalue(self, section) local i = tonumber(m.uci:get("olsrd", section, "TcInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "TcInterval", 2)) local v = tonumber(m.uci:get("olsrd", section, "TcValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "TcValidityTime", 256)) return "%.01fs / %.01fs" %{ i, v } end mid = ifs:option(DummyValue, "_mid", translate("MID")) function mid.cfgvalue(self, section) local i = tonumber(m.uci:get("olsrd", section, "MidInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "MidInterval", 18)) local v = tonumber(m.uci:get("olsrd", section, "MidValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "MidValidityTime", 324)) return "%.01fs / %.01fs" %{ i, v } end hna = ifs:option(DummyValue, "_hna", translate("HNA")) function hna.cfgvalue(self, section) local i = tonumber(m.uci:get("olsrd", section, "HnaInterval")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HnaInterval", 18)) local v = tonumber(m.uci:get("olsrd", section, "HnaValidityTime")) or tonumber(m.uci:get_first("olsrd", "InterfaceDefaults", "HnaValidityTime", 108)) return "%.01fs / %.01fs" %{ i, v } end return m
apache-2.0
cshore-firmware/openwrt-luci
applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua
39
3926
-- Copyright 2015 Jian Chang <aa65535@live.com> -- Licensed to the public under the Apache License 2.0. local m, s, o, e, a if luci.sys.call("pidof ss-redir >/dev/null") == 0 then m = Map("shadowsocks-libev", translate("ShadowSocks-libev"), translate("ShadowSocks-libev is running")) else m = Map("shadowsocks-libev", translate("ShadowSocks-libev"), translate("ShadowSocks-libev is not running")) end e = { "table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "salsa20", "chacha20", } -- Global Setting s = m:section(TypedSection, "shadowsocks-libev", translate("Global Setting")) s.anonymous = true o = s:option(Flag, "enable", translate("Enable")) o.default = 1 o.rmempty = false o = s:option(Value, "server", translate("Server Address")) o.datatype = "ipaddr" o.rmempty = false o = s:option(Value, "server_port", translate("Server Port")) o.datatype = "port" o.rmempty = false o = s:option(Value, "local_port", translate("Local Port")) o.datatype = "port" o.default = 1080 o.rmempty = false o = s:option(Value, "timeout", translate("Connection Timeout")) o.datatype = "uinteger" o.default = 60 o.rmempty = false o = s:option(Value, "password", translate("Password")) o.password = true o.rmempty = false o = s:option(ListValue, "encrypt_method", translate("Encrypt Method")) for i,v in ipairs(e) do o:value(v) end o.rmempty = false o = s:option(Value, "ignore_list", translate("Ignore List")) o:value("/dev/null", translate("Disabled")) o.default = "/dev/null" o.rmempty = false -- UDP Relay s = m:section(TypedSection, "shadowsocks-libev", translate("UDP Relay")) s.anonymous = true o = s:option(ListValue, "udp_mode", translate("Relay Mode")) o:value("0", translate("Disabled")) o:value("1", translate("Enabled")) o:value("2", translate("Custom")) o.default = 0 o.rmempty = false o = s:option(Value, "udp_server", translate("Server Address")) o.datatype = "ipaddr" o:depends("udp_mode", 2) o = s:option(Value, "udp_server_port", translate("Server Port")) o.datatype = "port" o:depends("udp_mode", 2) o = s:option(Value, "udp_local_port", translate("Local Port")) o.datatype = "port" o.default = 1081 o:depends("udp_mode", 2) o = s:option(Value, "udp_timeout", translate("Connection Timeout")) o.datatype = "uinteger" o.default = 60 o:depends("udp_mode", 2) o = s:option(Value, "udp_password", translate("Password")) o.password = true o:depends("udp_mode", 2) o = s:option(ListValue, "udp_encrypt_method", translate("Encrypt Method")) for i,v in ipairs(e) do o:value(v) end o:depends("udp_mode", 2) -- UDP Forward s = m:section(TypedSection, "shadowsocks-libev", translate("UDP Forward")) s.anonymous = true o = s:option(Flag, "tunnel_enable", translate("Enable")) o.default = 1 o.rmempty = false o = s:option(Value, "tunnel_port", translate("UDP Local Port")) o.datatype = "port" o.default = 5300 o = s:option(Value, "tunnel_forward", translate("Forwarding Tunnel")) o.default = "8.8.4.4:53" -- Access Control s = m:section(TypedSection, "shadowsocks-libev", translate("Access Control")) s.anonymous = true s:tab("lan_ac", translate("LAN")) o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("Access Control")) o:value("0", translate("Disabled")) o:value("1", translate("Allow listed only")) o:value("2", translate("Allow all except listed")) o.default = 0 o.rmempty = false a = luci.sys.net.arptable() or {} o = s:taboption("lan_ac", DynamicList, "lan_ac_ip", translate("LAN IP List")) o.datatype = "ipaddr" for i,v in ipairs(a) do o:value(v["IP address"]) end s:tab("wan_ac", translate("WAN")) o = s:taboption("wan_ac", DynamicList, "wan_bp_ip", translate("Bypassed IP")) o.datatype = "ip4addr" o = s:taboption("wan_ac", DynamicList, "wan_fw_ip", translate("Forwarded IP")) o.datatype = "ip4addr" return m
apache-2.0
MalRD/darkstar
scripts/zones/Windurst_Walls/Zone.lua
9
2709
----------------------------------- -- -- Zone: Windurst_Walls (239) -- ----------------------------------- local ID = require("scripts/zones/Windurst_Walls/IDs") require("scripts/globals/conquest") require("scripts/globals/settings") require("scripts/globals/keyitems") require("scripts/globals/missions") require("scripts/globals/quests") require("scripts/globals/zone") ----------------------------------- function onInitialize(zone) zone:registerRegion(1, -2,-17,140, 2,-16,142); end; function onZoneIn(player,prevZone) local cs = -1; -- MOG HOUSE EXIT if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then position = math.random(1,5) - 123; player:setPos(-257.5,-5.05,position,0); if (player:getMainJob() ~= player:getCharVar("PlayerMainJob")) then cs = 30004; end player:setCharVar("PlayerMainJob",0); elseif (ENABLE_ASA == 1 and player:getCurrentMission(ASA) == dsp.mission.id.asa.A_SHANTOTTO_ASCENSION and (prevZone == dsp.zone.WINDURST_WATERS or prevZone == dsp.zone.WINDURST_WOODS) and player:getMainLvl()>=10) then cs = 510; elseif (player:getCurrentMission(WINDURST) == dsp.mission.id.windurst.MOON_READING and player:getCharVar("MissionStatus") == 4) then cs = 443; end return cs; end; function onConquestUpdate(zone, updatetype) dsp.conq.onConquestUpdate(zone, updatetype) end; function onRegionEnter(player,region) switch (region:GetRegionID()): caseof { [1] = function (x) -- Heaven's Tower enter portal player:startEvent(86); end, } end; function onRegionLeave(player,region) end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 86) then player:setPos(0,0,-22.40,192,242); elseif (csid == 30004 and option == 0) then player:setHomePoint(); player:messageSpecial(ID.text.HOMEPOINT_SET); elseif (csid == 510) then player:startEvent(514); elseif (csid == 514) then player:completeMission(ASA,dsp.mission.id.asa.A_SHANTOTTO_ASCENSION); player:addMission(ASA,dsp.mission.id.asa.BURGEONING_DREAD); player:setCharVar("ASA_Status",0); elseif (csid == 443) then player:completeMission(WINDURST,dsp.mission.id.windurst.MOON_READING); player:setCharVar("MissionStatus",0); player:setRank(10); player:addGil(GIL_RATE*100000); player:messageSpecial(ID.text.GIL_OBTAINED,GIL_RATE*100000); player:addItem(183); player:messageSpecial(ID.text.ITEM_OBTAINED,183); player:addTitle(dsp.title.VESTAL_CHAMBERLAIN); end end;
gpl-3.0
ThingMesh/openwrt-luci
modules/admin-full/luasrc/model/cbi/admin_system/system.lua
39
5650
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2011 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- require("luci.sys") require("luci.sys.zoneinfo") require("luci.tools.webadmin") require("luci.fs") require("luci.config") local m, s, o local has_ntpd = luci.fs.access("/usr/sbin/ntpd") m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone.")) m:chain("luci") s = m:section(TypedSection, "system", translate("System Properties")) s.anonymous = true s.addremove = false s:tab("general", translate("General Settings")) s:tab("logging", translate("Logging")) s:tab("language", translate("Language and Style")) -- -- System Properties -- o = s:taboption("general", DummyValue, "_systime", translate("Local Time")) o.template = "admin_system/clock_status" o = s:taboption("general", Value, "hostname", translate("Hostname")) o.datatype = "hostname" function o.write(self, section, value) Value.write(self, section, value) luci.sys.hostname(value) end o = s:taboption("general", ListValue, "zonename", translate("Timezone")) o:value("UTC") for i, zone in ipairs(luci.sys.zoneinfo.TZ) do o:value(zone[1]) end function o.write(self, section, value) local function lookup_zone(title) for _, zone in ipairs(luci.sys.zoneinfo.TZ) do if zone[1] == title then return zone[2] end end end AbstractValue.write(self, section, value) local timezone = lookup_zone(value) or "GMT0" self.map.uci:set("system", section, "timezone", timezone) luci.fs.writefile("/etc/TZ", timezone .. "\n") end -- -- Logging -- o = s:taboption("logging", Value, "log_size", translate("System log buffer size"), "kiB") o.optional = true o.placeholder = 16 o.datatype = "uinteger" o = s:taboption("logging", Value, "log_ip", translate("External system log server")) o.optional = true o.placeholder = "0.0.0.0" o.datatype = "ip4addr" o = s:taboption("logging", Value, "log_port", translate("External system log server port")) o.optional = true o.placeholder = 514 o.datatype = "port" o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level")) o:value(8, translate("Debug")) o:value(7, translate("Info")) o:value(6, translate("Notice")) o:value(5, translate("Warning")) o:value(4, translate("Error")) o:value(3, translate("Critical")) o:value(2, translate("Alert")) o:value(1, translate("Emergency")) o = s:taboption("logging", ListValue, "cronloglevel", translate("Cron Log Level")) o.default = 8 o:value(5, translate("Debug")) o:value(8, translate("Normal")) o:value(9, translate("Warning")) -- -- Langauge & Style -- o = s:taboption("language", ListValue, "_lang", translate("Language")) o:value("auto") local i18ndir = luci.i18n.i18ndir .. "base." for k, v in luci.util.kspairs(luci.config.languages) do local file = i18ndir .. k:gsub("_", "-") if k:sub(1, 1) ~= "." and luci.fs.access(file .. ".lmo") then o:value(k, v) end end function o.cfgvalue(...) return m.uci:get("luci", "main", "lang") end function o.write(self, section, value) m.uci:set("luci", "main", "lang", value) end o = s:taboption("language", ListValue, "_mediaurlbase", translate("Design")) for k, v in pairs(luci.config.themes) do if k:sub(1, 1) ~= "." then o:value(v, k) end end function o.cfgvalue(...) return m.uci:get("luci", "main", "mediaurlbase") end function o.write(self, section, value) m.uci:set("luci", "main", "mediaurlbase", value) end -- -- NTP -- if has_ntpd then -- timeserver setup was requested, create section and reload page if m:formvalue("cbid.system._timeserver._enable") then m.uci:section("system", "timeserver", "ntp", { server = { "0.openwrt.pool.ntp.org", "1.openwrt.pool.ntp.org", "2.openwrt.pool.ntp.org", "3.openwrt.pool.ntp.org" } } ) m.uci:save("system") luci.http.redirect(luci.dispatcher.build_url("admin/system", arg[1])) return end local has_section = false m.uci:foreach("system", "timeserver", function(s) has_section = true return false end) if not has_section then s = m:section(TypedSection, "timeserver", translate("Time Synchronization")) s.anonymous = true s.cfgsections = function() return { "_timeserver" } end x = s:option(Button, "_enable") x.title = translate("Time Synchronization is not configured yet.") x.inputtitle = translate("Setup Time Synchronization") x.inputstyle = "apply" else s = m:section(TypedSection, "timeserver", translate("Time Synchronization")) s.anonymous = true s.addremove = false o = s:option(Flag, "enable", translate("Enable NTP client")) o.rmempty = false function o.cfgvalue(self) return luci.sys.init.enabled("sysntpd") and self.enabled or self.disabled end function o.write(self, section, value) if value == self.enabled then luci.sys.init.enable("sysntpd") luci.sys.call("env -i /etc/init.d/sysntpd start >/dev/null") else luci.sys.call("env -i /etc/init.d/sysntpd stop >/dev/null") luci.sys.init.disable("sysntpd") end end o = s:option(Flag, "enable_server", translate("Provide NTP server")) o:depends("enable", "1") o = s:option(DynamicList, "server", translate("NTP server candidates")) o.datatype = "host" o:depends("enable", "1") -- retain server list even if disabled function o.remove() end end end return m
apache-2.0
MalRD/darkstar
scripts/globals/items/serving_of_cibarious_cilbir.lua
11
1304
----------------------------------------- -- ID: 5643 -- Item: serving_of_cibarious_cilbir -- Food Effect: 4Hrs, All Races ----------------------------------------- -- HP % 6 (cap 150) -- MP % 6 (cap 100) -- HP recovered while healing 3 -- MP recovered while healing 4 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,14400,5643) end function onEffectGain(target, effect) target:addMod(dsp.mod.FOOD_HPP, 6) target:addMod(dsp.mod.FOOD_HP_CAP, 150) target:addMod(dsp.mod.FOOD_MPP, 6) target:addMod(dsp.mod.FOOD_MP_CAP, 100) target:addMod(dsp.mod.MPHEAL, 4) target:addMod(dsp.mod.HPHEAL, 3) end function onEffectLose(target, effect) target:delMod(dsp.mod.FOOD_HPP, 6) target:delMod(dsp.mod.FOOD_HP_CAP, 150) target:delMod(dsp.mod.FOOD_MPP, 6) target:delMod(dsp.mod.FOOD_MP_CAP, 100) target:delMod(dsp.mod.MPHEAL, 4) target:delMod(dsp.mod.HPHEAL, 3) end
gpl-3.0
peterkohaut/scummvm
devtools/create_ultima/files/ultima6/scripts/u6/ending.lua
18
12340
local g_img_tbl = {} local START_YEAR = 161 local START_MONTH = 7 local START_DAY = 4 local function wait_for_input() local input = nil while input == nil do canvas_update() input = input_poll() if input ~= nil then break end end return input end local g_pal_counter = 0 local star_field = nil local function stones_rotate_palette() if g_pal_counter == 4 then canvas_rotate_palette(16, 16) g_pal_counter = 0 else g_pal_counter = g_pal_counter + 1 end end local function rotate_and_wait() local input = nil while input == nil do image_update_effect(star_field.image) stones_rotate_palette() canvas_update() input = input_poll() if input ~= nil then break end end end local function update_star_field_and_wait() local input = nil while input == nil do image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then break end end end local function play() canvas_set_opacity(0xff); mouse_cursor_visible(false) g_img_tbl = image_load_all("end.shp") music_play("brit.m") --[ [ canvas_set_palette("endpal.lbm", 0) canvas_set_update_interval(25) sprite_new(g_img_tbl[7], 0, 0, true)--bg image_set_transparency_colour(g_img_tbl[0], 0) star_field = sprite_new(image_new_starfield(114,94), 106, 0, false) star_field.clip_x = 106 star_field.clip_y = 0 star_field.clip_w = 107 star_field.clip_h = 84 image_update_effect(star_field.image) local codex = sprite_new(g_img_tbl[1], 0x97, 0x1d, false) local codex_opened = sprite_new(g_img_tbl[2], 0x85, 0x17, false) local wall_transparent = sprite_new(g_img_tbl[0], 106, 0, false)--wall local wall = sprite_new(g_img_tbl[4], 106, 0, true)--wall moongate = sprite_new(g_img_tbl[3], 9, 0x7d, true)--moongate moongate.clip_x = 0 moongate.clip_y = 0 moongate.clip_w = 320 moongate.clip_h = 0x7e local characters = sprite_new(g_img_tbl[8], 0, 0, false) characters.clip_x = 0 characters.clip_y = 0 characters.clip_w = 160 characters.clip_h = 200 local characters1 = sprite_new(g_img_tbl[9], 0, 0, false) characters1.clip_x = 0 characters1.clip_y = 0 characters1.clip_w = 160 characters1.clip_h = 200 local blue_lens = sprite_new(g_img_tbl[5], 0x49, 0x57, true)--lens local red_lens = sprite_new(g_img_tbl[6], 0xda, 0x57, true)--lens local scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "A glowing portal springs from the floor!", 7, 303, 34, 13, 0x3e) local scroll = sprite_new(scroll_img, 1, 0xa0, true) local input local i for i=0x7d,-0xc,-1 do stones_rotate_palette() moongate.y = i canvas_update() input = input_poll() if input ~= nil then moongate.y = -0xc break end end rotate_and_wait() characters.visible = true scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "From its crimson depths Lord British emerges, trailed by the mage Nystul. Anguish and disbelief prevail on the royal seer's face, but Lord British directs his stony gaze at you and speaks as if to a wayward child.", 8, 303, 7, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 rotate_and_wait() scroll_img = image_load("end.shp", 0xc) image_print(scroll_img, "\"Thou didst have just cause to burgle our Codex, I trust\127 His Majesty says. \"But for Virtue's sake...", 8, 303, 7, 12, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x97 for i=-0xc,0x7d,1 do stones_rotate_palette() moongate.y = i canvas_update() input = input_poll() if input ~= nil then moongate.y = 0x7d break end end moongate.visible = false wait_for_input() scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "\"WHAT HAST THOU DONE WITH IT?\127", 8, 303, 63, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x0 scroll.y = 0xa0 wait_for_input() scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "You pick up the concave lens and pass it to the King. \"Was the book ever truly ours, Your Majesty? Was it written for Britannia alone? Thou dost no longer hold the Codex, but is its wisdom indeed lost? Look into the Vortex, and let the Codex answer for itself!\127", 8, 303, 7, 8, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 wait_for_input() blue_lens.visible = false characters.clip_x = 160 characters.clip_w = 160 characters.visible = false characters1.visible = true wait_for_input() scroll_img = image_load("end.shp", 0xc) image_print(scroll_img, "As Lord British holds the glass before the wall, the Codex of Ultimate Wisdom wavers into view against a myriad of swimming stars!", 8, 303, 7, 12, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x97 star_field.visible = true wall_transparent.visible = true for i=0xff,0,-3 do wall.opacity = i image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then wall.opacity = 0 break end end codex.opacity = 0 codex.visible = true for i=0,0xff,3 do codex.opacity = i image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then codex.opacity = 0xff break end end update_star_field_and_wait() scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "Yet the book remains closed.", 8, 303, 70, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x0 scroll.y = 0xa0 update_star_field_and_wait() music_play("gargoyle.m") scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "And waves of heat shimmer in the air, heralding the birth of another red gate!", 8, 303, 7, 9, 0x3e) scroll.image = scroll_img scroll.x = 0x0 scroll.y = 0x98 moongate.x = 0xe6 moongate.y = 0x7d moongate.visible = true for i=0x7d,-0xc,-1 do image_update_effect(star_field.image) stones_rotate_palette() moongate.y = i canvas_update() input = input_poll() if input ~= nil then moongate.y = -0xc break end end rotate_and_wait() characters.visible = true scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "King Draxinusom of the Gargoyles strides forward, flanked by a small army of wingless attendants. Like Lord British, he seems to suppress his rage only through a heroic effort of will. His scaly hand grasps your shoulder, and your Amulet of Submission grows very warm.", 8, 303, 7, 8, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 rotate_and_wait() scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "\"Thy time hath come, Thief,\127 he says.", 8, 303, 46, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x0 scroll.y = 0xa0 for i=-0xc,0x7d,1 do image_update_effect(star_field.image) stones_rotate_palette() moongate.y = i canvas_update() input = input_poll() if input ~= nil then moongate.y = 0x7d break end end moongate.visible = false update_star_field_and_wait() scroll_img = image_load("end.shp", 0xb) image_print(scroll_img, "Quickly you reach down to seize the convex lens...", 8, 310, 5, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x0 scroll.y = 0x98 update_star_field_and_wait() scroll_img = image_load("end.shp", 0xc) image_print(scroll_img, "...and you press it into the hand of the towering Gargoyle king, meeting his sunken eyes. \"Join my Lord in his search for peace, I beg thee.\127", 8, 303, 7, 12, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x97 update_star_field_and_wait() characters.visible = false characters1.clip_w = 320 red_lens.visible = false scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "At your urging, King Draxinusom reluctantly raises his lens to catch the light. As Lord British holds up his own lens, every eye in the room, human and Gargoyle alike, fixes upon the image of the Codex which shines upon the wall.", 8, 303, 7, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 update_star_field_and_wait() music_play("end.m") scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "The ancient book opens. Both kings gaze upon its pages in spellbound silence, as the eloquence of Ultimate Wisdom is revealed in the tongues of each lord's domain. You, too, can read the answers the Codex gives...", 8, 303, 7, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 codex_opened.opacity = 0 codex_opened.visible = true for i=0,0xff,3 do codex_opened.opacity = i image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then codex_opened.opacity = 0xff break end end codex.visible = false update_star_field_and_wait() scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "...and when its wisdom is gleaned, when Lord British and King Draxinusom turn to each other as friends, hating no longer, fearing no more, you know that your mission in Britannia has ended at last.", 8, 303, 7, 13, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x85 update_star_field_and_wait() scroll.visible = false for i=0xff,0,-3 do codex_opened.opacity = i image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then codex_opened.opacity = 0 break end end codex_opened.visible = false wall.opacity = 0 wall.visible = true for i=0,0xff,3 do wall.opacity = i image_update_effect(star_field.image) canvas_update() input = input_poll() if input ~= nil then wall.opacity = 0xff break end end star_field.visible=false wait_for_input() for i=0xff,0,-3 do canvas_set_opacity(i) canvas_update() end canvas_hide_all_sprites() canvas_set_opacity(0xff) local num_string = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine" } local year = clock_get_year() if year == nil then year = 161 end local month = clock_get_month() if month == nil then month = 7 end local day = clock_get_day() if day == nil then day = 4 end local current_days = year * 365 + month * 30 + day local start_days = START_YEAR * 365 + START_MONTH * 30 + START_DAY local time = current_days - start_days local years = math.floor(time / 365) local months = math.floor((time - years * 365) / 30) local days = time - (years * 365 + months * 30) local line1 = "" if years > 0 then if years > 29 then line1 = line1..years.." year" else line1 = line1..num_string[years+1].." year" end if years > 1 then line1 = line1.."s" end end if months > 0 then if line1 ~= "" then line1 = line1..", " end line1 = line1..num_string[months+1].." month" if months > 1 then line1 = line1.."s" end end local line2 = "" if days > 0 or line1 == "" then if line1 ~= "" then line1 = line1.."," line2 = "and " end line2 = line2..num_string[days+1].." day" if days ~= 1 then line2 = line2.."s" end end if line1 == "" then line1 = "Prophet, in" else line1 = "Prophet, in "..line1 end if string.len(line1.." "..line2) <= 38 and line2 ~= "" then line1 = line1.." "..line2 line2 = "" end if line2 == "" then line1 = line1.."." else line2 = line2.."." end local x, y y=9 scroll_img = image_load("end.shp", 0xa) image_print(scroll_img, "CONGRATULATIONS", 8, 303, 107, y, 0x3e) y=y+8 image_print(scroll_img, "Thou hast completed Ultima VI: The False", 8, 303, 34, y, 0x3e) y=y+8 image_print(scroll_img, line1, 8, 303, math.floor((318-canvas_string_length(line1)) / 2), y, 0x3e) y=y+8 if line2 ~= "" then image_print(scroll_img, line2, 8, 303, math.floor((318-canvas_string_length(line2)) / 2), y, 0x3e) y=y+8 end image_print(scroll_img, "Report thy feat unto Lord British at Origin", 8, 303, 23, y, 0x3e) y=y+8 image_print(scroll_img, "Systems!", 8, 303, 132, y, 0x3e) scroll.image = scroll_img scroll.x = 0x1 scroll.y = 0x44 scroll.opacity = 0 scroll.visible = true for i=0,0xff,3 do scroll.opacity = i canvas_update() input = input_poll() if input ~= nil then scroll.opacity = 0xff break end end wait_for_input() end play()
gpl-3.0
Lsty/ygopro-scripts
c37195861.lua
6
1316
--E・HERO オーシャン function c37195861.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(37195861,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCountLimit(1) e1:SetCondition(c37195861.con) e1:SetTarget(c37195861.tg) e1:SetOperation(c37195861.op) c:RegisterEffect(e1) end function c37195861.con(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c37195861.filter(c) return c:IsSetCard(0x8) and c:IsAbleToHand() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) end function c37195861.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(0x14) and chkc:IsControler(tp) and c37195861.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c37195861.op(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
gpl-2.0
ThingMesh/openwrt-luci
libs/web/luasrc/http/protocol/date.lua
88
2760
--[[ HTTP protocol implementation for LuCI - date handling (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- --- LuCI http protocol implementation - date helper class. -- This class contains functions to parse, compare and format http dates. module("luci.http.protocol.date", package.seeall) require("luci.sys.zoneinfo") MONTHS = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } --- Return the time offset in seconds between the UTC and given time zone. -- @param tz Symbolic or numeric timezone specifier -- @return Time offset to UTC in seconds function tz_offset(tz) if type(tz) == "string" then -- check for a numeric identifier local s, v = tz:match("([%+%-])([0-9]+)") if s == '+' then s = 1 else s = -1 end if v then v = tonumber(v) end if s and v then return s * 60 * ( math.floor( v / 100 ) * 60 + ( v % 100 ) ) -- lookup symbolic tz elseif luci.sys.zoneinfo.OFFSET[tz:lower()] then return luci.sys.zoneinfo.OFFSET[tz:lower()] end end -- bad luck return 0 end --- Parse given HTTP date string and convert it to unix epoch time. -- @param data String containing the date -- @return Unix epoch time function to_unix(date) local wd, day, mon, yr, hr, min, sec, tz = date:match( "([A-Z][a-z][a-z]), ([0-9]+) " .. "([A-Z][a-z][a-z]) ([0-9]+) " .. "([0-9]+):([0-9]+):([0-9]+) " .. "([A-Z0-9%+%-]+)" ) if day and mon and yr and hr and min and sec then -- find month local month = 1 for i = 1, 12 do if MONTHS[i] == mon then month = i break end end -- convert to epoch time return tz_offset(tz) + os.time( { year = yr, month = month, day = day, hour = hr, min = min, sec = sec } ) end return 0 end --- Convert the given unix epoch time to valid HTTP date string. -- @param time Unix epoch time -- @return String containing the formatted date function to_http(time) return os.date( "%a, %d %b %Y %H:%M:%S GMT", time ) end --- Compare two dates which can either be unix epoch times or HTTP date strings. -- @param d1 The first date or epoch time to compare -- @param d2 The first date or epoch time to compare -- @return -1 - if d1 is lower then d2 -- @return 0 - if both dates are equal -- @return 1 - if d1 is higher then d2 function compare(d1, d2) if d1:match("[^0-9]") then d1 = to_unix(d1) end if d2:match("[^0-9]") then d2 = to_unix(d2) end if d1 == d2 then return 0 elseif d1 < d2 then return -1 else return 1 end end
apache-2.0
MalRD/darkstar
scripts/zones/Norg/npcs/Magephaud.lua
9
2026
----------------------------------- -- Area: Norg -- NPC: Magephaud -- Standard Info NPC ----------------------------------- local ID = require("scripts/zones/Norg/IDs") require("scripts/globals/keyitems") require("scripts/globals/quests") require("scripts/globals/titles") ----------------------------------- function onTrade(player,npc,trade) EveryonesGrudge = player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.EVERYONES_GRUDGE); if (EveryonesGrudge == QUEST_ACCEPTED) then if (trade:hasItemQty(748,3) and trade:getItemCount() == 3) then player:startEvent(118,748); end end end; function onTrigger(player,npc) nFame = player:getFameLevel(NORG); if (player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.EVERYONES_GRUDGE) == QUEST_AVAILABLE and player:getCharVar("EVERYONES_GRUDGE_KILLS") >= 1 and nFame >= 2) then player:startEvent(116,748); -- Quest start - you have tonberry kills?! I got yo back ^.- elseif (player:getCharVar("EveryonesGrudgeStarted") == 1) then player:startEvent(117,748); elseif (player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.EVERYONES_GRUDGE) == QUEST_COMPLETED) then player:startEvent(119); -- After completion cs else player:startEvent(115); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 116) then player:addQuest(OUTLANDS,dsp.quest.id.outlands.EVERYONES_GRUDGE); player:setCharVar("EveryonesGrudgeStarted",1); elseif (csid == 118) then player:completeQuest(OUTLANDS,dsp.quest.id.outlands.EVERYONES_GRUDGE); player:tradeComplete(); player:addFame(NORG,80); player:addKeyItem(dsp.ki.TONBERRY_PRIEST_KEY); -- Permanent Tonberry key player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.TONBERRY_PRIEST_KEY); player:setCharVar("EveryonesGrudgeStarted",0); player:addTitle(dsp.title.HONORARY_DOCTORATE_MAJORING_IN_TONBERRIES); end end;
gpl-3.0
MalRD/darkstar
scripts/globals/items/blind_bolt.lua
12
1045
----------------------------------------- -- ID: 18150 -- Item: Blind Bolt -- Additional Effect: Blindness ----------------------------------------- require("scripts/globals/status") require("scripts/globals/magic") require("scripts/globals/msg") ----------------------------------- function onAdditionalEffect(player,target,damage) local chance = 95 if (target:getMainLvl() > player:getMainLvl()) then chance = chance - 5 * (target:getMainLvl() - player:getMainLvl()) chance = utils.clamp(chance, 5, 95) end if (target:hasImmunity(64)) then return 0,0,0 elseif (math.random(0,99) >= chance or applyResistanceAddEffect(player,target,dsp.magic.ele.DARK,0) <= 0.5) then return 0,0,0 else target:delStatusEffect(dsp.effect.BLINDNESS) if (not target:hasStatusEffect(dsp.effect.BLINDNESS)) then target:addStatusEffect(dsp.effect.BLINDNESS, 10, 0, 30) end return dsp.subEffect.BLIND, dsp.msg.basic.ADD_EFFECT_STATUS, dsp.effect.BLINDNESS end end
gpl-3.0
MalRD/darkstar
scripts/zones/Dynamis-Xarcabard/mobs/Animated_Dagger.lua
9
1177
----------------------------------- -- Area: Dynamis - Xarcabard -- Mob: Animated Dagger ----------------------------------- require("scripts/globals/status"); local ID = require("scripts/zones/Dynamis-Xarcabard/IDs"); ----------------------------------- function onMobEngaged(mob,target) if (mob:AnimationSub() == 3) then SetDropRate(103,1572,1000); else SetDropRate(103,1572,0); end target:showText(mob,ID.text.ANIMATED_DAGGER_DIALOG); SpawnMob(17330306):updateEnmity(target); SpawnMob(17330307):updateEnmity(target); SpawnMob(17330308):updateEnmity(target); SpawnMob(17330316):updateEnmity(target); SpawnMob(17330317):updateEnmity(target); SpawnMob(17330318):updateEnmity(target); end; function onMobFight(mob,target) -- TODO: add battle dialog end; function onMobDisengage(mob) mob:showText(mob,ID.text.ANIMATED_DAGGER_DIALOG+2); end; function onMobDeath(mob, player, isKiller) player:showText(mob,ID.text.ANIMATED_DAGGER_DIALOG+1); DespawnMob(17330306); DespawnMob(17330307); DespawnMob(17330308); DespawnMob(17330316); DespawnMob(17330317); DespawnMob(17330318); end;
gpl-3.0
ThingMesh/openwrt-luci
applications/luci-olsr/luasrc/model/cbi/olsr/olsrdiface.lua
49
6797
--[[ LuCI - Lua Configuration Interface Copyright 2010 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- local util = require "luci.util" local ip = require "luci.ip" function write_float(self, section, value) local n = tonumber(value) if n ~= nil then return Value.write(self, section, "%.1f" % n) end end m = Map("olsrd", translate("OLSR Daemon - Interface"), translate("The OLSR daemon is an implementation of the Optimized Link State Routing protocol. ".. "As such it allows mesh routing for any network equipment. ".. "It runs on any wifi card that supports ad-hoc mode and of course on any ethernet device. ".. "Visit <a href='http://www.olsr.org'>olsrd.org</a> for help and documentation.")) m.redirect = luci.dispatcher.build_url("admin/services/olsrd") if not arg[1] or m.uci:get("olsrd", arg[1]) ~= "Interface" then luci.http.redirect(m.redirect) return end i = m:section(NamedSection, arg[1], "Interface", translate("Interface")) i.anonymous = true i.addremove = false i:tab("general", translate("General Settings")) i:tab("addrs", translate("IP Addresses")) i:tab("timing", translate("Timing and Validity")) ign = i:taboption("general", Flag, "ignore", translate("Enable"), translate("Enable this interface.")) ign.enabled = "0" ign.disabled = "1" ign.rmempty = false function ign.cfgvalue(self, section) return Flag.cfgvalue(self, section) or "0" end network = i:taboption("general", Value, "interface", translate("Network"), translate("The interface OLSRd should serve.")) network.template = "cbi/network_netlist" network.widget = "radio" network.nocreate = true mode = i:taboption("general", ListValue, "Mode", translate("Mode"), translate("Interface Mode is used to prevent unnecessary packet forwarding on switched ethernet interfaces. ".. "valid Modes are \"mesh\" and \"ether\". Default is \"mesh\".")) mode:value("mesh") mode:value("ether") mode.optional = true mode.rmempty = true weight = i:taboption("general", Value, "Weight", translate("Weight"), translate("When multiple links exist between hosts the weight of interface is used to determine the link to use. ".. "Normally the weight is automatically calculated by olsrd based on the characteristics of the interface, ".. "but here you can specify a fixed value. Olsrd will choose links with the lowest value.<br />".. "<b>Note:</b> Interface weight is used only when LinkQualityLevel is set to 0. ".. "For any other value of LinkQualityLevel, the interface ETX value is used instead.")) weight.optional = true weight.datatype = "uinteger" weight.placeholder = "0" lqmult = i:taboption("general", DynamicList, "LinkQualityMult", translate("LinkQuality Multiplicator"), translate("Multiply routes with the factor given here. Allowed values are between 0.01 and 1.0. ".. "It is only used when LQ-Level is greater than 0. Examples:<br />".. "reduce LQ to 192.168.0.1 by half: 192.168.0.1 0.5<br />".. "reduce LQ to all nodes on this interface by 20%: default 0.8")) lqmult.optional = true lqmult.rmempty = true lqmult.cast = "table" lqmult.placeholder = "default 1.0" function lqmult.validate(self, value) for _, v in pairs(value) do if v ~= "" then local val = util.split(v, " ") local host = val[1] local mult = val[2] if not host or not mult then return nil, translate("LQMult requires two values (IP address or 'default' and multiplicator) seperated by space.") end if not (host == "default" or ip.IPv4(host) or ip.IPv6(host)) then return nil, translate("Can only be a valid IPv4 or IPv6 address or 'default'") end if not tonumber(mult) or tonumber(mult) > 1 or tonumber(mult) < 0.01 then return nil, translate("Invalid Value for LQMult-Value. Must be between 0.01 and 1.0.") end if not mult:match("[0-1]%.[0-9]+") then return nil, translate("Invalid Value for LQMult-Value. You must use a decimal number between 0.01 and 1.0 here.") end end end return value end ip4b = i:taboption("addrs", Value, "Ip4Broadcast", translate("IPv4 broadcast"), translate("IPv4 broadcast address for outgoing OLSR packets. One useful example would be 255.255.255.255. ".. "Default is \"0.0.0.0\", which triggers the usage of the interface broadcast IP.")) ip4b.optional = true ip4b.datatype = "ip4addr" ip4b.placeholder = "0.0.0.0" ip6m = i:taboption("addrs", Value, "IPv6Multicast", translate("IPv6 multicast"), translate("IPv6 multicast address. Default is \"FF02::6D\", the manet-router linklocal multicast.")) ip6m.optional = true ip6m.datatype = "ip6addr" ip6m.placeholder = "FF02::6D" ip4s = i:taboption("addrs", Value, "IPv4Src", translate("IPv4 source"), translate("IPv4 src address for outgoing OLSR packages. Default is \"0.0.0.0\", which triggers usage of the interface IP.")) ip4s.optional = true ip4s.datatype = "ip4addr" ip4s.placeholder = "0.0.0.0" ip6s = i:taboption("addrs", Value, "IPv6Src", translate("IPv6 source"), translate("IPv6 src prefix. OLSRd will choose one of the interface IPs which matches the prefix of this parameter. ".. "Default is \"0::/0\", which triggers the usage of a not-linklocal interface IP.")) ip6s.optional = true ip6s.datatype = "ip6addr" ip6s.placeholder = "0::/0" hi = i:taboption("timing", Value, "HelloInterval", translate("Hello interval")) hi.optional = true hi.datatype = "ufloat" hi.placeholder = "5.0" hi.write = write_float hv = i:taboption("timing", Value, "HelloValidityTime", translate("Hello validity time")) hv.optional = true hv.datatype = "ufloat" hv.placeholder = "40.0" hv.write = write_float ti = i:taboption("timing", Value, "TcInterval", translate("TC interval")) ti.optional = true ti.datatype = "ufloat" ti.placeholder = "2.0" ti.write = write_float tv = i:taboption("timing", Value, "TcValidityTime", translate("TC validity time")) tv.optional = true tv.datatype = "ufloat" tv.placeholder = "256.0" tv.write = write_float mi = i:taboption("timing", Value, "MidInterval", translate("MID interval")) mi.optional = true mi.datatype = "ufloat" mi.placeholder = "18.0" mi.write = write_float mv = i:taboption("timing", Value, "MidValidityTime", translate("MID validity time")) mv.optional = true mv.datatype = "ufloat" mv.placeholder = "324.0" mv.write = write_float ai = i:taboption("timing", Value, "HnaInterval", translate("HNA interval")) ai.optional = true ai.datatype = "ufloat" ai.placeholder = "18.0" ai.write = write_float av = i:taboption("timing", Value, "HnaValidityTime", translate("HNA validity time")) av.optional = true av.datatype = "ufloat" av.placeholder = "108.0" av.write = write_float return m
apache-2.0
Lsty/ygopro-scripts
c95816395.lua
3
1542
--どぐう function c95816395.initial_effect(c) --to grave local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_TO_GRAVE) e1:SetOperation(c95816395.regop) c:RegisterEffect(e1) end function c95816395.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if rp~=tp and c:IsReason(REASON_EFFECT) then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(95816395,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetRange(LOCATION_GRAVE) e1:SetTarget(c95816395.thtg) e1:SetOperation(c95816395.thop) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end function c95816395.cfilter(c,lv) return c:GetLevel()==lv end function c95816395.filter(c,tp) return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not Duel.IsExistingMatchingCard(c95816395.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,c:GetLevel()) end function c95816395.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c95816395.filter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c95816395.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c95816395.filter,tp,LOCATION_DECK,0,1,1,nil,tp) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
gpl-2.0
MalRD/darkstar
scripts/globals/effects/last_resort.lua
12
1102
----------------------------------- -- -- dsp.effect.LAST_RESORT -- ----------------------------------- require("scripts/globals/status") ----------------------------------- function onEffectGain(target, effect) target:addMod(dsp.mod.ATTP, 25 + target:getMerit(dsp.merit.LAST_RESORT_EFFECT)) target:addMod(dsp.mod.HASTE_ABILITY, target:getMod(dsp.mod.DESPERATE_BLOWS) + target:getMerit(dsp.merit.DESPERATE_BLOWS)) -- Gear that affects this mod is handled by a Latent Effect because the gear must remain equipped target:addMod(dsp.mod.DEFP, -25 - target:getMerit(dsp.merit.LAST_RESORT_EFFECT)) end function onEffectTick(target, effect) end function onEffectLose(target, effect) target:delMod(dsp.mod.ATTP, 25 + target:getMerit(dsp.merit.LAST_RESORT_EFFECT)) target:delMod(dsp.mod.HASTE_ABILITY, target:getMod(dsp.mod.DESPERATE_BLOWS) + target:getMerit(dsp.merit.DESPERATE_BLOWS)) -- Gear that affects this mod is handled by a Latent Effect because the gear must remain equipped target:delMod(dsp.mod.DEFP, -25 - target:getMerit(dsp.merit.LAST_RESORT_EFFECT)) end
gpl-3.0
starius/kodomoquiz
fbb.lua
1
8212
local module = {} module.as_list = { 'tuser', 'aba', 'dendik', 'dendik2', 'grisha', 'artemov', 'manyashka', 'illusionoflife', 'thewatcher', 'davtyan.a', 'stepadenisov', 's.denisov', 'udavdasha', 'dasg', 'ase', 'feniouk', 'mgelfand', 'golovin', 'aegor', 'den', 'grishin', 'prep', 'julia_50291', 'bylino', 'hovhannd', 'Mko', 'Anahit', 'ermakova', 'khrameeva', 'mashak', 'ishmudip', 'tiger', 'tiger2', 'koroleva', 'lan787', 'aramaki', 'k_tanya', 'elenaleonova', 'mardashova', 'anushm', 'amironov', 'serge2006', 'iamoskvin', 'snaumenko', 'gelena', 'nikitin_m', 'anna', 'quant', 'psn', 'ok', 'bennigsen', 'Popinako', 'pxeno', 'abr', 'ravcheyev', 'reshetn', 'ellys', 'faues', 'pupil', 'irina', 'sheval_e', 'leveller', 'gsim', 'lks', 'rust', 'sas', 'stavrovskaya', 'sutormin', 'sisoev', 'tregubova', 'varzhabetyan.l', 'kinta', 'zanolia', 'dian', 'akmarina', 'dbadmaev', 'polina_bai', 'vanya', 'e.biryukova', 'boyko.s', 'chapliyk', 'chaplyk', 'diankin', 'e.dontsov', 'efremov_aleksei', 'efremov_aleks', 'polietilenglikol', 'vladislaw_aesc', 'denisgrishaev96', 'pvolk96', 'ilnitsky', 'ivan', 'ivavovasd', 'ivanova_sd', 'nataliya.kashko', 'arinka', 'arinka_0596', 'nknjasewa', 'kolupaeva', 'askorzina', 'a.kozlova', 'explover', 'anandia', 'neoblako', 'maria', 'mnikolaev', 'polina-na', 'chlamidomonas', 'elenaoch', 'nooroka', 'ranhummer', 'dariya.portugalskaya', 'riuminkd', 'grigorij', 'margarita', 'tana_shir', 'arma', 'tatiana.sh', 'talianash', 'crescent8547', 'sstarikov', 'a_lex', 'nuts', 'danil.zuev', 'batyrsha', 'froltasa', 'gorbokonenko', 'test2014', 'aamosova', 'annlinnaeus', 'volkiller', 'ksberezina', 'bezsudnovao', 'katerinabiryukova', 'sofia.buyanova', 'artas317', 'andrei-demkiv', 'alexei', 'darkvampirewolf', 'dyugay.ilya', 'alexgavrilov', 'daria', 'anton', 'zuka', 'rainy', 'partyhard', 'puru-rin', 'ikuznetsov', 'mnim', 'n.lanina', 'val_ma', 'pogorelskaya', 'loven-doo', 'liza.mukhaleva', 'yarik', 'prosvirov.k', 'sarkisyan14', 'eshvetsova', 'asofronova', 'ksfq1450', 'kuararo', 'sunnymouse', 'alpha', 'sashayakusheva', 'svetyalana', 'liquoricemint', 'alexander.zlobin', 'khudyakova', 'aakor', 'mikemoldovan', 'alibek', 'a_andreeva', 'anfimova_kate', 'alessandrick', 'keygen', 'lizaveta', 'db12', 'bainabos', 'dvdianov', 'dudinadar', 'cheriant', 'evstafyeva', 'rita501', 'fedorovaad1995', 'portakal', 'fedor.g', 'kotiara', 'phil.gusev', 'allakarpova', 'natalya_kh', 'olesya', 'servalli', 'lyapunov', 'maleevacobalt', 'krookie', 'medvedev', 'markmeerson', 'avkitex', 'katerina', 'abbadon', 'nuzhdina', 'obraztsova', 'pankevich-ev', 'popov', 'danilaonfire', 'kamelott_95', 'favrori', 'iltarn', 'raskolnikova', 'strunil', 'sutormin94', 'soniarabi', 'travin', 'nitrushina', 'vakulenko_julia', 'annabeth495', 'aleshin_vasily', 'sonia196512', 'whitelord_1994', 'saturu', 'dirichlet', 'bsshka', 'jerryj', 'sapsan', 'ghtyus', 'virgo-an', 'julia.chudakova', 'hemmulio', 'julia-eliseeva', 'lenafomenko', 'agalicina', 'baceolus', 'marinakalina', 'miku', 'nastyam', 'vladef', 'janemoiseeva', 'morozova_ea', 'fransilvion', 'trilobit', 'eugeniaprokhorova', 'ksenia_chan', 'daniel', 'taisniqm', 'asil777', 'tskir', 'maringer', 'dimon94', 'abdullaev', 'ksandra', 'ekaandreyanova', 'nastya_7ast', 'anasteya', 'belushk', 'dashadv', 'alisa', 'irina111', 'cdg', 'irina17s', 'mariyaiv', 'kochetova_m', 'colin_kondr', 'alkon94', 'annette_delune', 'tim_079', 'fox', 'deosypov', 'stalker', 'warmaster6', 'sliderpro', 'shadrina92', 'bruneto4ka', 'blackdaffodil', 'impbios93', 'pizzador', 'tsepkova_p', 'anton.vaset', 'rafiki', 'silwer', 'zotova', 'achmiz', 'adjanova', 'nagaina', 'muravej', 'svetlana', 'ruslan', 'foxenia', 'artur_galimov', 'gall', 'ivanova', 'mrvi', 'kochmak', 'hydrobiont', 'dicar', 'zyxel', 'hell', 'lota', 'nevedomskaya', 'nilov', 'olovnikov', 'perts', 'daniil', 'burnnick', 'lissian', 'venel', 'amid', 'spaniel', 'paulvstrashnov', 'genesup', 'sycheva', 'nadin', 'austyugov', 'vikhreva', 'natalia', 'pechkin', 'woodruff', 'alexartex', 'nadelle4', 'borodyanskaya', 'nikola', 'lelik', 'kondra', 'dolgov', 'kolobok', 'adelya', 'eremeev', 'wave', 'grushanka', 'igorek_msu', 'sanchezz', 'ivliev', 'sorriso', 'nastya', 'siniy', 'jonik', 'tricky', 'kuzzia', 'vik', 'niko', 'kathrine', 'cheshirec', 'dgyanikas', 'silva', 'panchin', 'margo', 'ratmanova', 'punk', 'piotr1', 'shustova', 'kozyavka', 'ninka', 'tasha', 'maxi_jazz', 'marusya_tula', 'sulwen', 'ait', 'amrita', 'nameless', 'zini', 'madge', 'mashik', 'tanya', 'gilza', 'vovan_chemick', 'alamat', 'solnishko', 'kaspersky', 'dydychkin', 'istar', 'fastum', 'galkin_-_deathseller', 'igpers', 'vershina', 'kamina', 'strelets', 'try2fly', 'syrena', 'footkicker', 'human', 'konstantin', 'lohmatikov', 'loukian', 'lenusik', 'redwitch', 'mazin', 'mihasia', 'oggy_13th', 'jjigor', 'cossack', 'reshetov', 'alien', 'cherry', 'd04shagam', 'lenashustrik', 'snegir', 'spielman', 'matilda', 'manon', 'mtih', 'dracon', 'eva', 'sever', 'melli', 'wiolanta', 'abrludmila', 'mumla', 'kut', 'contradiction', 'nihilenia', 'mango', 'knyaz', 'dubovenko', 'nasting', 'yefremov', 'aksinia', 'sds', 'mart', 'dragon98', 'haaalbert', 'vampire', 'yaros', 'jarinka', 'alex', 'mikhail88', 'megacounterfeit', 'belarus', 'lavda', 'leushkin', 'falkor', 'mmetelev', 'milanovsky', 'aleshenka', 'manya', 'baduol', 'lilu', 'x-files', 'pengrin', 'etrangere', 'stas', 'christablel', 'christine', 'lloss', 'vovan', 'rimma', 'sensu', 'anya88', 'svit', 'pavel_s', 'kowka3', 'yulya_82', 'phoenix', 'sorochkinaa', 'solveig', 'vlada', 'igogo', 'vakh57', 'famil', 'golergka', 'roman', 'sandra', 'alextrust', 'alcarin', 'pyrotekhnik_89', 'alexandra', 'danilenko', 'sench', 'vanilin', 'phoenix-wright', 'h0n0da', 'fomka', 'naf812', 'marina_g', 'gmarusja', 'tusena', 'ivyura', 'misha_j', 'jenechka', 'monika', 'kiral', 'rhymester_dan', 'fusor', 'anahita', 'lvserega', 'ogion', 'ulya', 'tatahin', 'jesus_crist', 'sendio', 'podkovkina', 'element', 'affendi', 'pouliakhina', 'pozdyshev', 'maestro', 'kleva', 'vasilisa', 'delfinhic', 'zloygenii13', 'shakirov', 'dina', 'agnetta', 'xedin', 'step', 'stetzen', 'anastaisha_w', 'turgenev', 'shure_beta', 'robo_tema', 'ushaloxstii314', 'lile4ka', 'molotok', 'entian', 'pashtetbor', 'cherry1989', 'lesiad', 'alisikfox90', 'scorper', 'loontic', 'kiraly', 'nrar', 'jene4ka_13', 'kolesnikova', 'krasniimak89', 'aelita', 'jimsonweed89', 'desislava', 'plazmoliz', 'franzlutzov', 'da_shal', 'asya17_0456', 'step_vita', 'terekhanova', 'jane_tikhonova', 'svetra', 'lupus', 'darkhan', 'anuta_al', 'lu.andreeva', 'marine', 'magepie', 'moshka', 'victor_byant', 'mumin', 'd_duvanov_s', 'golikov_v', 'youthofchemist', 'nivunja', 'mashunia', 'xenia_l', 'mamichev-ivan', 'greyerg', 'martiran', 'vangogi', 'ksenechka91', 'alexus', 'ramil.mintaev', 'garik', 'bnagaev', 'julia_p', 'ipoverennaya', 'maravilla', 'v.romashchenko', 'is_rusinov', 'seferyan_m', 'olesia-nebo', 'student08fbb', 'vermilion_991', 'smivic', 'anya_fbb', 'lukina', 'lesya', 'artem-tok', 'katrin-vesna', 'alex2308', 'vika-chan', 'ksenia_yashina', 'zamaraev', 'megabotan', 'haretsuon', 'a_anisenko', 'borisevich', 'miss_lazy', 'dashkache', 'homo_sapiens', 'margo77', 'kropa8848', 'darli', 'm.g', 'nastia', 'juliaka16', 'kostyrko', 'empire_patrol', 'lynx', 'sonaida', 'anzhela', 'naika1991naika', 'julia270692', 'popkov-v', 'lpopova', 'irbis', 'alexa-sh', 'sinitcyn', 'gosha-x', 'sudakov', 'crazy.dashko', 'iren', 'turaro', 'zhuravlka', 'olya_zol', 'whitequark', 'p.avdiunina', 'volkiller', 'evgevg', 'emkeller', 'elenavas', 'inna-volynkina', 'annavoron', 'ggavrish', 'galivondzhyan', 'geraseva', 'gladmarine', 'romanoff-k', 'dzhavrunova_yekaterina', 'antonio', 's.isaev', 'asya.kalashnikova', 'romakalendr', 'annakaran', 'ann_karpukhina', 'kotyurgin_alex', 'goracio', 'ksenia1697', 'creepyorange', 'lena.lipen', 'litvinanna', 'a.lomakin', 'bioinvlad', 'smargasyuk', 'mek', 'lizaminina', 'klukva', 'alex_morozov', 'nassonova.anna', 'friland', 'ozerov.kir', 'pavlova.nataliya', 'alex-petrukhin', 'ulyana', 'atp_abuser', 'es_posicel', 'july.preobrazhencki', 'emadevich', 'iskandersabirov', 'seferbekova', 'alestep', 'anastasia_teplova', 'atitova', 'rustam', 'haleminhduong', 'tsvetcovroman', 'acherep', 'aidar', } module.as_dict = {} for k, v in pairs(module.as_list) do module.as_dict[v] = 1 end return module
mit
keyidadi/luci
applications/luci-statistics/luasrc/model/cbi/luci_statistics/netlink.lua
78
2765
--[[ Luci configuration model for statistics - collectd netlink plugin configuration (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- require("luci.sys") local devices = luci.sys.net.devices() m = Map("luci_statistics", translate("Netlink Plugin Configuration"), translate( "The netlink plugin collects extended informations like " .. "qdisc-, class- and filter-statistics for selected interfaces." )) -- collectd_netlink config section s = m:section( NamedSection, "collectd_netlink", "luci_statistics" ) -- collectd_netlink.enable enable = s:option( Flag, "enable", translate("Enable this plugin") ) enable.default = 0 -- collectd_netlink.interfaces (Interface) interfaces = s:option( MultiValue, "Interfaces", translate("Basic monitoring") ) interfaces.widget = "select" interfaces.optional = true interfaces.size = #devices + 1 interfaces:depends( "enable", 1 ) interfaces:value("") for i, v in ipairs(devices) do interfaces:value(v) end -- collectd_netlink.verboseinterfaces (VerboseInterface) verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", translate("Verbose monitoring") ) verboseinterfaces.widget = "select" verboseinterfaces.optional = true verboseinterfaces.size = #devices + 1 verboseinterfaces:depends( "enable", 1 ) verboseinterfaces:value("") for i, v in ipairs(devices) do verboseinterfaces:value(v) end -- collectd_netlink.qdiscs (QDisc) qdiscs = s:option( MultiValue, "QDiscs", translate("Qdisc monitoring") ) qdiscs.widget = "select" qdiscs.optional = true qdiscs.size = #devices + 1 qdiscs:depends( "enable", 1 ) qdiscs:value("") for i, v in ipairs(devices) do qdiscs:value(v) end -- collectd_netlink.classes (Class) classes = s:option( MultiValue, "Classes", translate("Shaping class monitoring") ) classes.widget = "select" classes.optional = true classes.size = #devices + 1 classes:depends( "enable", 1 ) classes:value("") for i, v in ipairs(devices) do classes:value(v) end -- collectd_netlink.filters (Filter) filters = s:option( MultiValue, "Filters", translate("Filter class monitoring") ) filters.widget = "select" filters.optional = true filters.size = #devices + 1 filters:depends( "enable", 1 ) filters:value("") for i, v in ipairs(devices) do filters:value(v) end -- collectd_netlink.ignoreselected (IgnoreSelected) ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") ) ignoreselected.default = 0 ignoreselected:depends( "enable", 1 ) return m
apache-2.0
eagle14/Snippy-robot
plugins/groupmanager.lua
136
11323
-- data saved to moderation.json -- check moderation plugin do local function create_group(msg) -- superuser and admins only (because sudo are always has privilege) if not is_admin(msg) then return "You're not admin!" end local group_creator = msg.from.print_name create_group_chat (group_creator, group_name, ok_cb, false) return 'Group '..string.gsub(group_name, '_', ' ')..' has been created.' end local function set_description(msg, data) if not is_momod(msg) then return "For moderators only!" end local data_cat = 'description' data[tostring(msg.to.id)][data_cat] = deskripsi save_data(_config.moderation.data, data) return 'Set group description to:\n'..deskripsi end local function get_description(msg, data) local data_cat = 'description' if not data[tostring(msg.to.id)][data_cat] then return 'No description available.' end local about = data[tostring(msg.to.id)][data_cat] local about = string.gsub(msg.to.print_name, "_", " ")..':\n\n'..about return 'About '..about end local function set_rules(msg, data) if not is_momod(msg) then return "For moderators only!" end local data_cat = 'rules' data[tostring(msg.to.id)][data_cat] = rules save_data(_config.moderation.data, data) return 'Set group rules to:\n'..rules end local function get_rules(msg, data) local data_cat = 'rules' if not data[tostring(msg.to.id)][data_cat] then return 'No rules available.' end local rules = data[tostring(msg.to.id)][data_cat] local rules = string.gsub(msg.to.print_name, '_', ' ')..' rules:\n\n'..rules return rules end -- lock/unlock group name. bot automatically change group name when locked local function lock_group_name(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_name_set = data[tostring(msg.to.id)]['settings']['set_name'] local group_name_lock = data[tostring(msg.to.id)]['settings']['lock_name'] if group_name_lock == 'yes' then return 'Group name is already locked' else data[tostring(msg.to.id)]['settings']['lock_name'] = 'yes' save_data(_config.moderation.data, data) data[tostring(msg.to.id)]['settings']['set_name'] = string.gsub(msg.to.print_name, '_', ' ') save_data(_config.moderation.data, data) return 'Group name has been locked' end end local function unlock_group_name(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_name_set = data[tostring(msg.to.id)]['settings']['set_name'] local group_name_lock = data[tostring(msg.to.id)]['settings']['lock_name'] if group_name_lock == 'no' then return 'Group name is already unlocked' else data[tostring(msg.to.id)]['settings']['lock_name'] = 'no' save_data(_config.moderation.data, data) return 'Group name has been unlocked' end end --lock/unlock group member. bot automatically kick new added user when locked local function lock_group_member(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_member_lock = data[tostring(msg.to.id)]['settings']['lock_member'] if group_member_lock == 'yes' then return 'Group members are already locked' else data[tostring(msg.to.id)]['settings']['lock_member'] = 'yes' save_data(_config.moderation.data, data) end return 'Group members has been locked' end local function unlock_group_member(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_member_lock = data[tostring(msg.to.id)]['settings']['lock_member'] if group_member_lock == 'no' then return 'Group members are not locked' else data[tostring(msg.to.id)]['settings']['lock_member'] = 'no' save_data(_config.moderation.data, data) return 'Group members has been unlocked' end end --lock/unlock group photo. bot automatically keep group photo when locked local function lock_group_photo(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_photo_lock = data[tostring(msg.to.id)]['settings']['lock_photo'] if group_photo_lock == 'yes' then return 'Group photo is already locked' else data[tostring(msg.to.id)]['settings']['set_photo'] = 'waiting' save_data(_config.moderation.data, data) end return 'Please send me the group photo now' end local function unlock_group_photo(msg, data) if not is_momod(msg) then return "For moderators only!" end local group_photo_lock = data[tostring(msg.to.id)]['settings']['lock_photo'] if group_photo_lock == 'no' then return 'Group photo is not locked' else data[tostring(msg.to.id)]['settings']['lock_photo'] = 'no' save_data(_config.moderation.data, data) return 'Group photo has been unlocked' end end local function set_group_photo(msg, success, result) local data = load_data(_config.moderation.data) local receiver = get_receiver(msg) if success then local file = 'data/photos/chat_photo_'..msg.to.id..'.jpg' print('File downloaded to:', result) os.rename(result, file) print('File moved to:', file) chat_set_photo (receiver, file, ok_cb, false) data[tostring(msg.to.id)]['settings']['set_photo'] = file save_data(_config.moderation.data, data) data[tostring(msg.to.id)]['settings']['lock_photo'] = 'yes' save_data(_config.moderation.data, data) send_large_msg(receiver, 'Photo saved!', ok_cb, false) else print('Error downloading: '..msg.id) send_large_msg(receiver, 'Failed, please try again!', ok_cb, false) end end -- show group settings local function show_group_settings(msg, data) if not is_momod(msg) then return "For moderators only!" end local settings = data[tostring(msg.to.id)]['settings'] local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member return text end function run(msg, matches) --vardump(msg) if matches[1] == 'creategroup' and matches[2] then group_name = matches[2] return create_group(msg) end if not is_chat_msg(msg) then return "This is not a group chat." end local data = load_data(_config.moderation.data) local receiver = get_receiver(msg) if msg.media and is_chat_msg(msg) and is_momod(msg) then if msg.media.type == 'photo' and data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings']['set_photo'] == 'waiting' then load_photo(msg.id, set_group_photo, msg) end end end if data[tostring(msg.to.id)] then local settings = data[tostring(msg.to.id)]['settings'] if matches[1] == 'setabout' and matches[2] then deskripsi = matches[2] return set_description(msg, data) end if matches[1] == 'about' then return get_description(msg, data) end if matches[1] == 'setrules' then rules = matches[2] return set_rules(msg, data) end if matches[1] == 'rules' then return get_rules(msg, data) end if matches[1] == 'group' and matches[2] == 'lock' then --group lock * if matches[3] == 'name' then return lock_group_name(msg, data) end if matches[3] == 'member' then return lock_group_member(msg, data) end if matches[3] == 'photo' then return lock_group_photo(msg, data) end end if matches[1] == 'group' and matches[2] == 'unlock' then --group unlock * if matches[3] == 'name' then return unlock_group_name(msg, data) end if matches[3] == 'member' then return unlock_group_member(msg, data) end if matches[3] == 'photo' then return unlock_group_photo(msg, data) end end if matches[1] == 'group' and matches[2] == 'settings' then return show_group_settings(msg, data) end if matches[1] == 'chat_rename' then if not msg.service then return "Are you trying to troll me?" end local group_name_set = settings.set_name local group_name_lock = settings.lock_name local to_rename = 'chat#id'..msg.to.id if group_name_lock == 'yes' then if group_name_set ~= tostring(msg.to.print_name) then rename_chat(to_rename, group_name_set, ok_cb, false) end elseif group_name_lock == 'no' then return nil end end if matches[1] == 'setname' and is_momod(msg) then local new_name = string.gsub(matches[2], '_', ' ') data[tostring(msg.to.id)]['settings']['set_name'] = new_name save_data(_config.moderation.data, data) local group_name_set = data[tostring(msg.to.id)]['settings']['set_name'] local to_rename = 'chat#id'..msg.to.id rename_chat(to_rename, group_name_set, ok_cb, false) end if matches[1] == 'setphoto' and is_momod(msg) then data[tostring(msg.to.id)]['settings']['set_photo'] = 'waiting' save_data(_config.moderation.data, data) return 'Please send me new group photo now' end if matches[1] == 'chat_add_user' then if not msg.service then return "Are you trying to troll me?" end local group_member_lock = settings.lock_member local user = 'user#id'..msg.action.user.id local chat = 'chat#id'..msg.to.id if group_member_lock == 'yes' then chat_del_user(chat, user, ok_cb, true) elseif group_member_lock == 'no' then return nil end end if matches[1] == 'chat_delete_photo' then if not msg.service then return "Are you trying to troll me?" end local group_photo_lock = settings.lock_photo if group_photo_lock == 'yes' then chat_set_photo (receiver, settings.set_photo, ok_cb, false) elseif group_photo_lock == 'no' then return nil end end if matches[1] == 'chat_change_photo' and msg.from.id ~= 0 then if not msg.service then return "Are you trying to troll me?" end local group_photo_lock = settings.lock_photo if group_photo_lock == 'yes' then chat_set_photo (receiver, settings.set_photo, ok_cb, false) elseif group_photo_lock == 'no' then return nil end end end end return { description = "Plugin to manage group chat.", usage = { "!creategroup <group_name> : Create a new group (admin only)", "!setabout <description> : Set group description", "!about : Read group description", "!setrules <rules> : Set group rules", "!rules : Read group rules", "!setname <new_name> : Set group name", "!setphoto : Set group photo", "!group <lock|unlock> name : Lock/unlock group name", "!group <lock|unlock> photo : Lock/unlock group photo", "!group <lock|unlock> member : Lock/unlock group member", "!group settings : Show group settings" }, patterns = { "^!(creategroup) (.*)$", "^!(setabout) (.*)$", "^!(about)$", "^!(setrules) (.*)$", "^!(rules)$", "^!(setname) (.*)$", "^!(setphoto)$", "^!(group) (lock) (.*)$", "^!(group) (unlock) (.*)$", "^!(group) (settings)$", "^!!tgservice (.+)$", "%[(photo)%]", }, run = run, } end
gpl-2.0
Oliveryo/Interface
AddOns/Cartographer/Modules/Foglight.lua
1
37023
local revision = tonumber(string.sub("$Revision: 18625 $", 12, -3)) if revision > Cartographer.revision then Cartographer.version = "r" .. revision Cartographer.revision = revision Cartographer.date = string.sub("$Date: 2006-12-02 16:13:35 +0300 (Сб, 02 дек 2006) $", 8, 17) end -- if you want to add data to the defaults, send ckknight@gmail.com your -- C:\Program Files\World of Warcraft\WTF\Account\ACCOUNTNAME\SavedVariables\Cartographer.lua -- file. local L = AceLibrary("AceLocale-2.2"):new("Cartographer-Foglight") L:RegisterTranslations("enUS", function() return { ["Foglight"] = true, ["Module to show unexplored areas on the map."] = true, ["Unexplored color"] = true, ["Change the color of the unexplored areas"] = true, } end) L:RegisterTranslations("koKR", function() return { ["Foglight"] = "미 탐색 지역", ["Module to show unexplored areas on the map."] = "지도에 탐험하지 못한 지역을 보여줍니다.", ["Unexplored color"] = "색상", ["Change the color of the unexplored areas"] = "탐험하지 못한 지역의 색상을 변경합니다.", } end) local math_mod = math.fmod or math.mod local math_floor = math.floor local math_ceil = math.ceil local _G = getfenv(0) Cartographer_Foglight = Cartographer:NewModule("Foglight", "AceHook-2.1", "AceEvent-2.0") function Cartographer_Foglight:OnInitialize() ColorPickerFrame:SetFrameStrata("DIALOG") self.name = L["Foglight"] self.title = L["Foglight"] self.db = Cartographer:AcquireDBNamespace("Foglight") Cartographer:RegisterDefaults("Foglight", "profile", { darkR = 1, darkG = 1, darkB = 1, darkA = 1, }) Cartographer:RegisterDefaults("Foglight", "account", { errata = { ["LochModan"] = { ["VALLEYOFKINGS"] = 397399025859, ["IRONBANDSEXCAVATIONSITE"] = 345176801625, ["THELSAMAR"] = 218197367040, ["SILVERSTREAMMINE"] = 12051560683, ["THELOCH"] = 93785057600, ["MOGROSHSTRONGHOLD"] = 52108176699, ["THEFARSTRIDERLODGE"] = 214247447922, ["STONESPLINTERVALLEY"] = 373887890687, ["STONEWROUGHTDAM"] = 12166806818, ["GRIZZLEPAWRIDGE"] = 333184342311, ["NORTHGATEPASS"] = 13016281318, }, ["BurningSteppes"] = { ["TERRORWINGPATH"] = 50149559576, ["PILLAROFASH"] = 306412009792, ["BLACKROCKPASS"] = 300191897870, ["RUINSOFTHAURISSAN"] = 106838652174, ["DRACODAR"] = 277084433823, ["MORGANSVIGIL"] = 334676375846, ["BLACKROCKMOUNTAIN"] = 108629614848, ["ALTAROFSTORMS"] = 117075833057, ["BLACKROCKSTRONGHOLD"] = 122757063925, ["DREADMAULROCK"] = 181130200284, }, ["Moonglade"] = { ["LAKEELUNEARA"] = 95819397675, }, ["Barrens"] = { ["RATCHET"] = 203520341117, ["RAZORFENDOWNS"] = 594206117019, ["THEMERCHANTCOAST"] = 265823555679, ["GROLDOMFARM"] = 68161752189, ["CAMPTAURAJO"] = 376192496785, ["THEMORSHANRAMPART"] = 432115840, ["AGAMAGOR"] = 251612292296, ["HONORSSTAND"] = 139907432576, ["THORNHILL"] = 128297599116, ["THESLUDGEFEN"] = 478273706, ["RAPTORGROUNDS"] = 316211837043, ["DREADMISTPEAK"] = 68085195904, ["LUSHWATEROASIS"] = 190435222703, ["FIELDOFGIANTS"] = 432016611538, ["FARWATCHPOST"] = 56426140772, ["THEFORGOTTENPOOLS"] = 123883091064, ["RAZORFENKRAUL"] = 576957055104, ["NORTHWATCHFOLD"] = 330191462550, ["THESTAGNANTOASIS"] = 227064021147, ["BAELMODAN"] = 514774401152, ["BLACKTHORNRIDGE"] = 496420126875, ["BRAMBLESCAR"] = 320438703229, ["BOULDERLODEMINE"] = 582072440, ["THEDRYHILLS"] = 31471060168, ["THECROSSROADS"] = 127153630363, }, ["Winterspring"] = { ["LAKEKELTHERIL"] = 213021549783, ["WINTERFALLVILLAGE"] = 170298307729, ["FROSTWHISPERGORGE"] = 404275495112, ["MAZTHORIL"] = 277542523065, ["ICETHISTLEHILLS"] = 260486370429, ["THEHIDDENGROVE"] = 29573178543, ["TIMBERMAWPOST"] = 261159510246, ["EVERLOOK"] = 115424305317, ["DARKWHISPERGORGE"] = 473989068031, ["FROSTSABERROCK"] = 7902253306, ["OWLWINGTHICKET"] = 365694169253, ["STARFALLVILLAGE"] = 147513835705, ["FROSTFIREHOTSPRINGS"] = 184916521200, }, ["Hinterlands"] = { ["THECREEPINGRUIN"] = 279600867508, ["SERADANE"] = 20935101715, ["JINTHAALOR"] = 358085850347, ["HIRIWATHA"] = 328744509665, ["SHAOLWATHA"] = 257223243032, ["THEOVERLOOKCLIFFS"] = 326070753450, ["SKULKROCK"] = 249645122720, ["AGOLWATHA"] = 176486026445, ["PLAGUEMISTRAVINE"] = 160153432209, ["AERIEPEAK"] = 263080588543, ["QUELDANILLODGE"] = 198890949817, ["VALORWINDLAKE"] = 324604700842, ["THEALTAROFZUL"] = 392307053768, ["SHADRAALOR"] = 415789933763, }, ["Westfall"] = { ["WESTFALLLIGHTHOUSE"] = 501652584728, ["SENTINELHILL"] = 259235496131, ["JANGOLODEMINE"] = 31460646103, ["THEDUSTPLAINS"] = 405349313824, ["MOONBROOK"] = 355741147356, ["THEMOLSENFARM"] = 159257933025, ["ALEXSTONFARMSTEAD"] = 279386999089, ["DEMONTSPLACE"] = 402871477448, ["GOLDCOASTQUARRY"] = 109752615137, ["THEDAGGERHILLS"] = 449179729152, ["THEJANSENSTEAD"] = 511910053, ["SALDEANSFARM"] = 113224403169, ["THEDEADACRE"] = 271132639432, ["FURLBROWSPUMPKINFARM"] = 12217179346, }, ["Badlands"] = { ["APOCRYPHANSREST"] = 332878001407, ["THEDUSTBOWL"] = 213841628430, ["THEMAKERSTERRACE"] = 7924298997, ["CAMPCAGG"] = 459574309119, ["CAMPBOFF"] = 366671585535, ["LETHLORRAVINE"] = 118752746866, ["AGMONDSEND"] = 418047605001, ["CAMPKOSH"] = 52117598428, ["ANGORFORTRESS"] = 159254782147, ["MIRAGEFLATS"] = 412472295709, ["KARGATH"] = 158914051312, ["DUSTWINDGULCH"] = 224934442229, ["VALLEYOFFANGS"] = 275244095718, ["HAMMERTOESDIGSITE"] = 129315835080, }, ["Darkshore"] = { ["TOWEROFALTHALAXX"] = 91758988458, ["GROVEOFTHEANCIENTS"] = 442701621448, ["CLIFFSPRINGRIVER"] = 101325142246, ["AUBERDINE"] = 174279842966, ["THEMASTERSGLAIVE"] = 547953473711, ["REMTRAVELSEXCAVATION"] = 521005096111, ["AMETHARAN"] = 328904946878, ["RUINSOFMATHYSTRA"] = 534994115, ["BASHALARAN"] = 194730200244, }, ["WesternPlaguelands"] = { ["GAHRRONSWITHERING"] = 268980925620, ["DARROWMERELAKE"] = 368822204786, ["THONDRORILRIVER"] = 92960805069, ["FELSTONEFIELD"] = 334248408224, ["HEARTHGLEN"] = 17502077268, ["THEWEEPINGCAVE"] = 213194580128, ["NORTHRIDGELUMBERCAMP"] = 176494399708, ["THEWRITHINGHAUNT"] = 347291711658, ["DALSONSTEARS"] = 284941244636, ["RUINSOFANDORHOL"] = 381451213085, ["CAERDARROW"] = 443010946218, ["SORROWHILL"] = 496441178412, ["THEBULWARK"] = 314750199009, }, ["Desolace"] = { ["MAGRAMVILLAGE"] = 392534717645, ["VALLEYOFSPEARS"] = 231077082357, ["SHADOWPREYVILLAGE"] = 417860917478, ["TETHRISARAN"] = 452084941, ["THUNDERAXEFORTRESS"] = 109990604990, ["MANNOROCCOVEN"] = 408440561949, ["SARGERON"] = 36089091357, ["KODOGRAVEYARD"] = 262399060243, ["KOLKARVILLAGE"] = 231491203292, ["ETHELRETHOR"] = 65824614605, ["SHADOWBREAKRAVINE"] = 477465087181, ["GELKISVILLAGE"] = 457721497795, ["RANAZJARISLE"] = 6695260260, ["KORMEKSHUT"] = 194929393834, ["NIJELSPOINT"] = 581167304, }, ["Arathi"] = { ["THANDOLSPAN"] = 442754101448, ["NORTHFOLDMANOR"] = 96838336742, ["HAMMERFALL"] = 129536092365, ["BOULDERGOR"] = 155936085237, ["BOULDERFISTHALL"] = 389147765975, ["CIRCLEOFWESTBINDING"] = 58126977214, ["WITHERBARKVILLAGE"] = 358142396631, ["DABYRIESFARMSTEAD"] = 177662544052, ["CIRCLEOFINNERBINDING"] = 333160047826, ["CIRCLEOFOUTERBINDING"] = 315045866666, ["FALDIRSCOVE"] = 455446060288, ["GOSHEKFARM"] = 296909737190, ["THORADINSWALL"] = 148267843774, ["REFUGEPOINT"] = 200104182959, ["CIRCLEOFEASTBINDING"] = 120844425376, ["STROMGARDEKEEP"] = 308277385456, }, ["Durotar"] = { ["DRYGULCHRAVINE"] = 84199768274, ["ORGRIMMAR"] = 256016829, ["TIRAGARDEKEEP"] = 307574788286, ["THUNDERRIDGE"] = 64767598782, ["KOLKARCRAG"] = 511534293152, ["RAZORHILL"] = 182989330652, ["ECHOISLES"] = 459063673032, ["SENJINVILLAGE"] = 412814080160, ["SKULLROCK"] = 35920132224, ["RAZORMANEGROUNDS"] = 203253061862, ["VALLEYOFTRIALS"] = 343969848535, }, ["Tirisfal"] = { ["RUINSOFLORDAERON"] = 388106530107, ["MONASTARY"] = 135000159443, ["SCARLETWATCHPOST"] = 112391871663, ["STILLWATERPOND"] = 297840804026, ["BALNIRFARMSTEAD"] = 350700621016, ["BULWARK"] = 389426656486, ["VENOMWEBVALE"] = 220911065325, ["GARRENSHAUNT"] = 156213932206, ["BRIGHTWATERLAKE"] = 149865922761, ["DEATHKNELL"] = 352425555189, ["BRILL"] = 321612052608, ["NIGHTMAREVALE"] = 375116733683, ["COLDHEARTHMANOR"] = 351610732694, ["AGAMANDMILLS"] = 149601601792, ["CRUSADEROUTPOST"] = 311039230125, ["SOLLIDENFARMSTEAD"] = 268686225664, }, ["SwampOfSorrows"] = { ["MISTYVALLEY"] = 150324167925, ["MISTYREEDSTRAND"] = 782921984, ["THEHARBORAGE"] = 155872081131, ["POOLOFTEARS"] = 234668444972, ["SORROWMURK"] = 129608561879, ["STONARD"] = 254769687912, ["THESHIFTINGMIRE"] = 118411734331, ["SPLINTERSPEARJUNCTION"] = 253538582803, ["STAGALBOG"] = 406453479769, ["FALLOWSANCTUARY"] = 516212077, ["ITHARIUSSCAVE"] = 281320609008, }, ["StonetalonMountains"] = { ["WEBWINDERPATH"] = 303274757408, ["BOULDERSLIDERAVINE"] = 602969058449, ["CAMPAPARAJE"] = 613859558590, ["WINDSHEARCRAG"] = 212107283776, ["STONETALONPEAK"] = 259208462, ["SUNROCKRETREAT"] = 344005433494, ["SISHIRCANYON"] = 465428411517, ["GRIMTOTEMPOST"] = 553677611233, ["THECHARREDVALE"] = 251476151526, ["MALAKAJIN"] = 625613035645, ["MIRKFALLONLAKE"] = 156101729480, }, ["DunMorogh"] = { ["ANVILMAR"] = 432880674032, ["THETUNDRIDHILLS"] = 346292355227, ["COLDRIDGEPASS"] = 413700063382, ["IRONFORGE"] = 175436407099, ["ICEFLOWLAKE"] = 179609718912, ["FROSTMANEHOLD"] = 308391572605, ["MISTYPINEREFUGE"] = 237823497344, ["GOLBOLARQUARRY"] = 313096574117, ["AMBERSTILLRANCH"] = 301248675968, ["GNOMERAGON"] = 197742728372, ["HELMSBEDLAKE"] = 293859403931, ["THEGRIZZLEDDEN"] = 334263149768, ["SOUTHERNGATEOUTPOST"] = 300404564096, ["CHILLBREEZEVALLEY"] = 318115020980, ["NORTHERNGATEOUTPOST"] = 186553373824, ["BREWNALLVILLAGE"] = 267626073203, ["KHARANOS"] = 316085051592, ["SHIMMERRIDGE"] = 175383967872, }, ["SearingGorge"] = { ["BLACKCHARCAVE"] = 393070488851, ["THECAULDRON"] = 182798587305, ["FIREWATCHRIDGE"] = 32301824405, ["THESEAOFCINDERS"] = 416871113064, ["DUSTFIREVALLEY"] = 9032807884, ["TANNERCAMP"] = 437584632113, ["GRIMSILTDIGSITE"] = 322640769329, }, ["AlteracValley"] = { ["ICEBLOODGARRISON"] = 185035174188, ["DUNBALDAR"] = 14323794190, ["FROSTWOLFKEEP"] = 403071863019, }, ["Hilsbrad"] = { ["EASTERNSTRAND"] = 364548260070, ["PURGATIONISLE"] = 517657956477, ["DURNHOLDEKEEP"] = 81165399424, ["SOUTHPOINTTOWER"] = 206160758048, ["WESTERNSTRAND"] = 395355254045, ["SOUTHSHORE"] = 216260688107, ["AZURELOADMINE"] = 295462707365, ["NETHANDERSTEAD"] = 253970596055, ["TARRENMILL"] = 534042844, ["HILLSBRADFIELDS"] = 166637882673, ["DARROWHILL"] = 165790510285, ["DUNGAROK"] = 316348321008, }, ["Duskwood"] = { ["THEROTTINGORCHARD"] = 396776151290, ["ADDLESSTEAD"] = 367277631763, ["RAVENHILLCEMETARY"] = 160076968286, ["DARKSHIRE"] = 174608113979, ["RAVENHILL"] = 324377134275, ["THEDARKENEDBANK"] = 33379535758, ["BRIGHTWOODGROVE"] = 126156624092, ["TWILIGHTGROVE"] = 85138510184, ["VULGOLOGREMOUND"] = 373917250815, ["MANORMISTMANTLE"] = 129533918408, ["TRANQUILGARDENSCEMETARY"] = 379754606812, ["THEYORGENFARMSTEAD"] = 410578577643, ["THEHUSHEDBANK"] = 141754181792, }, ["ThousandNeedles"] = { ["THEGREATLIFT"] = 75377070290, ["WINDBREAKCANYON"] = 268951580912, ["HIGHPERCH"] = 166462683326, ["FREEWINDPOST"] = 283842377938, ["THESCREECHINGCANYON"] = 214936305914, ["DARKCLOUDPINNACLE"] = 140931960013, ["CAMPETHOK"] = 317745, ["THESHIMMERINGFLATS"] = 322762552640, ["SPLITHOOFCRAG"] = 206568623314, }, ["Ashenvale"] = { ["WARSONGLUMBERCAMP"] = 334768537800, ["THESHRINEOFAESSINA"] = 278208384220, ["THERUINSOFSTARDUST"] = 400778483867, ["THISTLEFURVILLAGE"] = 169864269055, ["FELFIREHILL"] = 370115083509, ["LAKEFALATHIM"] = 147240193152, ["IRISLAKE"] = 234486969544, ["MYSTRALLAKE"] = 372961952019, ["NIGHTRUN"] = 277651651809, ["MAESTRASPOST"] = 41017459927, ["THEZORAMSTRAND"] = 30084945141, ["SATYRNAAR"] = 242319811869, ["FALLENSKYLAKE"] = 457987798251, ["FIRESCARSHRINE"] = 348090711205, ["THEHOWLINGVALE"] = 151883277522, ["BOUGHSHADOW"] = 163032801426, ["ASTRANAAR"] = 269794600141, ["RAYNEWOODRETREAT"] = 256096064692, }, ["Teldrassil"] = { ["THEORACLEGLADE"] = 136650670250, ["WELLSPRINGLAKE"] = 100253565108, ["LAKEALAMETH"] = 408479261952, ["BANETHILHOLLOW"] = 302122223776, ["POOLSOFARLITHRIEN"] = 336432658560, ["DARNASSUS"] = 265320399163, ["STARBREEZEVILLAGE"] = 314121068744, ["GNARLPINEHOLD"] = 476053635257, ["SHADOWGLEN"] = 164797580513, ["RUTTHERANVILLAGE"] = 588928618624, ["DOLANAAR"] = 347303182526, }, ["BlastedLands"] = { ["DREADMAULPOST"] = 209758391541, ["GARRISONARMORY"] = 10158809258, ["SERPENTSCOIL"] = 150849366241, ["THETAINTEDSCAR"] = 191348803968, ["DARKPORTAL"] = 278574362889, ["RISEOFTHEDEFILER"] = 132495066282, ["ALTAROFSTORMS"] = 143132880057, ["DREADMAULHOLD"] = 16484847811, ["NETHERGARDEKEEP"] = 32798603449, }, ["Mulgore"] = { ["WINDFURYRIDGE"] = 414318797, ["WILDMANEWATERWELL"] = 305266873, ["THEVENTURECOMINE"] = 256108637409, ["REDCLOUDMESA"] = 456623640022, ["THEGOLDENPLAINS"] = 86348382423, ["THEROLLINGPLAINS"] = 382800689408, ["RAVAGEDCARAVAN"] = 279668973696, ["BLOODHOOFVILLAGE"] = 325728805120, ["THUNDERHORNWATERWELL"] = 260243090560, ["REDROCKS"] = 17706490061, ["BAELDUNDIGSITE"] = 230048321746, ["PALEMANEROCK"] = 329956668544, ["WINTERHOOFWATERWELL"] = 396691112106, ["THUNDERBLUFF"] = 63612109080, }, ["Felwood"] = { ["SHATTERSCARVALE"] = 132392362219, ["DEADWOODVILLAGE"] = 572732349615, ["IRONTREEWOODS"] = 58422680791, ["JADEFIREGLEN"] = 499638234277, ["JADEFIRERUN"] = 31484717251, ["BLOODVENOMFALLS"] = 282700432619, ["TALONBRANCHGLADE"] = 97211532448, ["JAEDENAR"] = 355692839157, ["FELPAWVILLAGE"] = 506610928, ["MORLOSARAN"] = 547054845073, ["EMERALDSANCTUARY"] = 461060079801, ["RUINSOFCONSTELLAS"] = 409407220971, }, ["Silverpine"] = { ["THESEPULCHER"] = 180757889234, ["MALDENSORCHARD"] = 487751936, ["THESHININGSTRAND"] = 14440165632, ["THEGREYMANEWALL"] = 480360226002, ["DEEPELEMMINE"] = 280739621024, ["AMBERMILL"] = 281838600432, ["THESKITTERINGDARK"] = 40028509369, ["NORTHTIDESHOLLOW"] = 137777774772, ["PYREWOODVILLAGE"] = 479298974860, ["THEDEADFIELD"] = 70214915247, ["BERENSPERIL"] = 448265375984, ["THEDECREPITFERRY"] = 155098211508, ["SHADOWFANGKEEP"] = 385855160540, ["FENRISISLE"] = 80078920954, ["OLSENSFARTHING"] = 270983685285, }, ["Aszhara"] = { ["SOUTHRIDGEBEACH"] = 379438985586, ["BITTERREACHES"] = 43625145589, ["FORLORNRIDGE"] = 396411272412, ["JAGGEDREEF"] = 383953466, ["RUINSOFELDARATH"] = 237546791177, ["TOWEROFELDARA"] = 115748269176, ["SHADOWSONGSHRINE"] = 453155934433, ["THALASSIANBASECAMP"] = 128298675440, ["THERUINEDREACHES"] = 580235952523, ["VALORMOK"] = 245975137495, ["HALDARRENCAMPMENT"] = 355489437896, ["RAVENCRESTMONUMENT"] = 536376112368, ["TEMPLEOFARKKORAN"] = 164996784318, ["URSOLAN"] = 102448192657, ["BAYOFSTORMS"] = 216324681998, ["THESHATTEREDSTRAND"] = 208729753760, ["LAKEMENNAR"] = 460945826107, ["TIMBERMAWHOLD"] = 114079054059, ["LEGASHENCAMPMENT"] = 47746003179, }, ["Elwynn"] = { ["NORTHSHIREVALLEY"] = 158239817984, ["EASTVALELOGGINGCAMP"] = 355073214720, ["BRACKWELLPUMPKINPATCH"] = 450503107840, ["FORESTSEDGE"] = 351243949312, ["JERODSLANDING"] = 463228613888, ["FARGODEEPMINE"] = 459811307776, ["RIDGEPOINTTOWER"] = 467807741234, ["CRYSTALLAKE"] = 356925010145, ["STORMWIND"] = 415205, ["TOWEROFAZORA"] = 314110634239, ["GOLDSHIRE"] = 290172662000, ["STONECAIRNLAKE"] = 204626723126, }, ["Tanaris"] = { ["SANDSORROWWATCH"] = 107687886019, ["STEAMWHEEDLEPORT"] = 81151547547, ["SOUTHMOONRUINS"] = 385812220099, ["WATERSPRINGFIELD"] = 180922536101, ["DUNEMAULCOMPOUND"] = 310652323021, ["VALLEYOFTHEWATCHERS"] = 466309251222, ["CAVERNSOFTIME"] = 275466311835, ["EASTMOONRUINS"] = 371929012384, ["ABYSSALSANDS"] = 208686731479, ["GADGETZAN"] = 98152125615, ["THISTLESHRUBVALLEY"] = 307303278777, ["LANDSENDBEACH"] = 549148849357, ["ZALASHJISDEN"] = 158480871534, ["THENOXIOUSLAIR"] = 213939069108, ["ZULFARRAK"] = 266517714, ["NOONSHADERUINS"] = 112228179064, ["LOSTRIGGERCOVE"] = 236882950304, ["BROKENPILLAR"] = 251751747694, ["THEGAPINGCHASM"] = 399902984412, ["SOUTHBREAKSHORE"] = 315129773271, }, ["Silithus"] = { ["THESCARABWALL"] = 443577270560, ["TWILIGHTBASECAMP"] = 211888111936, ["HIVEASHI"] = 13163102720, ["SOUTHWINDVILLAGE"] = 70317900160, ["HIVEREGAL"] = 306273714688, ["THECRYSTALVALE"] = 25879151936, ["HIVEZORA"] = 154721059200, }, ["Feralas"] = { ["SARDORISLE"] = 251473875124, ["FERALSCARVALE"] = 353770785907, ["ONEIROS"] = 75678988398, ["THETWINCOLOSSALS"] = 80865383709, ["FRAYFEATHERHIGHLANDS"] = 414965737582, ["THEFORGOTTENCOAST"] = 275301859473, ["THEWRITHINGDEEP"] = 320623309040, ["DIREMAUL"] = 216298360038, ["CAMPMOJACHE"] = 250904477851, ["LOWERWILDS"] = 213388546273, ["GRIMTOTEMCOMPOUND"] = 179968347256, ["RUINSOFISILDIEN"] = 344163870910, ["DREAMBOUGH"] = 476181654, ["ISLEOFDREAD"] = 402854810839, ["GORDUNNIOUTPOST"] = 152121283724, ["RUINSOFRAVENWIND"] = 319974590, }, ["EasternPlaguelands"] = { ["BLACKWOODLAKE"] = 214138334438, ["NORTHDALE"] = 138089280702, ["PLAGUEWOOD"] = 89298057576, ["ZULMASHAR"] = 32856249549, ["THEINFECTISSCAR"] = 313109269699, ["QUELLITHIENLODGE"] = 39097358566, ["PESTILENTSCAR"] = 370870053069, ["THEUNDERCROFT"] = 512355358905, ["THEFUNGALVALE"] = 280530995410, ["THONDRORILRIVER"] = 248042070236, ["CROWNGUARDTOWER"] = 430875776205, ["STRATHOLME"] = 9867305200, ["TYRSHAND"] = 506484402421, ["LIGHTSHOPECHAPEL"] = 321799836847, ["THEMARRISSTEAD"] = 386710844616, ["NORTHPASSTOWER"] = 117517257968, ["DARROWSHIRE"] = 525383945426, ["LAKEMERELDAR"] = 497705729274, ["EASTWALLTOWER"] = 259392700596, ["THENOXIOUSGLADE"] = 178998435041, ["TERRORDALE"] = 105309746366, ["CORINSCROSSING"] = 394626498725, }, ["UngoroCrater"] = { ["THESLITHERINGSCAR"] = 408407012697, ["FIREPLUMERIDGE"] = 191511148839, ["TERRORRUN"] = 395302958425, ["IRONSTONEPLATEAU"] = 72551265565, ["GOLAKKAHOTSPRINGS"] = 162262246715, ["THEMARSHLANDS"] = 258285604150, ["LAKKARITARPITS"] = 6610495034, }, ["Dustwallow"] = { ["THEDENOFFLAME"] = 336350931199, ["BACKBAYWETLANDS"] = 203188075920, ["THERAMOREISLE"] = 241078318310, ["BRACKENWALLVILLAGE"] = 241449240, ["ALCAZISLAND"] = 23240838344, ["THEWYRMBOG"] = 409480708381, ["WITCHHILL"] = 442821882, }, ["DeadwindPass"] = { ["KARAZHAN"] = 362133312812, ["DEADMANSCROSSING"] = 81865848188, ["THEVICE"] = 321495775502, }, ["Wetlands"] = { ["BLACKCHANNELMARSH"] = 263147666672, ["WHELGARSEXCAVATIONSITE"] = 220376261827, ["GRIMBATOL"] = 247601668446, ["MOSSHIDEFEN"] = 284020692173, ["RAPTORRIDGE"] = 189637230782, ["THEGREENBELT"] = 134696124601, ["MENETHILHARBOR"] = 337168695471, ["ANGERFANGENCAMPMENT"] = 234439763169, ["DUNMODR"] = 22969241805, ["THELGANROCK"] = 398851242214, ["BLUEGILLMARSH"] = 152564857057, ["SALTSPRAYGLEN"] = 44272173256, ["IRONBEARDSTOMB"] = 123846452424, ["DIREFORGEHILL"] = 124012194048, ["SUNDOWNMARSH"] = 88143544620, }, ["Redridge"] = { ["STONEWATCH"] = 231379087615, ["ALTHERSMILL"] = 138931353835, ["THREECORNERS"] = 304943036781, ["GALARDELLVALLEY"] = 173558458618, ["LAKESHIRE"] = 211614371156, ["REDRIDGECANYONS"] = 77436540269, ["STONEWATCHFALLS"] = 344221501760, ["LAKERIDGEHIGHWAY"] = 357752408494, ["RENDERSCAMP"] = 290717971, ["LAKEEVERSTILL"] = 257837780503, ["RENDERSVALLEY"] = 388128570833, }, ["Stranglethorn"] = { ["WILDSHORE"] = 453359368357, ["BOOTYBAY"] = 465143201937, ["RUINSOFZULMAMWE"] = 228046533802, ["BLOODSAILCOMPOUND"] = 305146281125, ["KALAIRUINS"] = 94802902111, ["MIZJAHRUINS"] = 140986398825, ["MISTVALEVALLEY"] = 395430720637, ["REBELCAMP"] = 297887914, ["BALALRUINS"] = 99037036634, ["VENTURECOBASECAMP"] = 69125403753, ["RUINSOFJUBUWAL"] = 323517266030, ["CRYSTALVEINMINE"] = 296714625144, ["JAGUEROISLE"] = 529684095101, ["BALIAMAHRUINS"] = 138901860462, ["ZULGURUB"] = 9096622325, ["ZUULDAIARUINS"] = 45260852339, ["NEKMANIWELLSPRING"] = 385694682202, ["MOSHOGGOGREMOUND"] = 101384895616, ["RUINSOFABORAZ"] = 360070610015, ["THEARENA"] = 203183809736, ["RUINSOFZULKUNDA"] = 3426889853, ["ZIATAJAIRUINS"] = 248416171136, ["KURZENSCOMPOUND"] = 407001243, ["THEVILEREEF"] = 96796327102, ["LAKENAZFERITI"] = 63697974400, ["NESINGWARYSEXPEDITION"] = 28199467148, ["GROMGOLBASECAMP"] = 142006658158, }, ["Alterac"] = { ["DANDREDSFOLD"] = 289642781, ["THEUPLANDS"] = 83162767595, ["DALARAN"] = 281347928364, ["SOFERASNAZE"] = 330123510015, ["LORDAMEREINTERNMENTCAMP"] = 432764364106, ["CHILLWINDPOINT"] = 272313469278, ["THEHEADLAND"] = 506061853861, ["CRUSHRIDGEHOLD"] = 174296645912, ["MISTYSHORE"] = 140865986780, ["GALLOWSCORNER"] = 299999895752, ["STRAHNBRAD"] = 113318867314, ["GAVINSNAZE"] = 513484700832, ["GROWLESSCAVE"] = 399764531390, ["RUINSOFALTERAC"] = 211810516223, ["CORRAHNSDAGGER"] = 408440570051, }, ["AzuremystIsle"] = { ["AzureWatch"] = 267763581184, ["MoongrazeWoods"] = 196965826816, ["StillpineHold"] = 52996342016, ["BristlelimbVillage"] = 389950996736, ["GreezlesCamp"] = 376341528832, ["WrathscalePoint"] = 452276247808, ["PodWreckage"] = 375220600960, ["PodCluster"] = 327786168576, ["AmmenFord"] = 300114247936, ["SiltingShore"] = 3526623488, ["Emberglade"] = 26281771264, ["TheExodar"] = 91346174464, ["FairbridgeStrand"] = 373424384, ["ValaarsBerth"] = 325528584448, ["OdesyusLanding"] = 406243770624, ["AmmenVale"] = 112222274011, ["SilvermystIsle"] = 478913198336, }, ["Netherstorm"] = { ["SocretharsSeat"] = 41042575616, ["NetherstormBridge"] = 315818770688, ["EtheriumStagingGrounds"] = 223842926848, ["TheStormspire"] = 144194142464, ["KirinVarVillage"] = 562080924928, ["ManaforgeCoruu"] = 525434277120, ["ManafrogeAra"] = 166609551616, ["TempestKeep"] = 305564877209, ["RuinsofFarahlon"] = 52984807936, ["RuinsofEnkaat"] = 323461841152, ["TheScrapField"] = 280620171520, ["CelestialRidge"] = 186432880896, ["ForgeBaseOG"] = 23871095040, ["RuinedManaforge"] = 148714553600, ["Area52"] = 416864665856, ["EcoDomeFarfield"] = 11152916736, ["Netherstone"] = 21906063616, ["ManaforgeBanar"] = 301875989760, ["ManaforgeDuro"] = 361265103104, ["ArklonRuins"] = 426619699456, ["TheHeap"] = 488803357952, ["SunfuryHold"] = 484733838592, }, ["Hellfire"] = { ["MagharPost"] = 118327869696, ["ZethGor"] = 462317402534, ["HonorHold"] = 320467108096, ["HellfireCitadel"] = 225840670976, ["TheLegionFront"] = 138046603520, ["WarpFields"] = 438409892096, ["TempleofTelhamat"] = 163249127936, ["VoidRidge"] = 395876499712, ["PoolsofAggonar"] = 48660742400, ["FalconWatch"] = 350232074752, ["ForgeCampRage"] = 27345289728, ["DenofHaalesh"] = 442572734720, ["TheStairofDestiny"] = 168277049600, ["FallenSkyRidge"] = 152507252992, ["Thrallmar"] = 165846188288, ["ThroneofKiljaeden"] = 6942884352, ["ExpeditionArmory"] = 443729313280, ["RuinsofShanaar"] = 311411730688, }, ["BladesEdgeMountains"] = { ["VekhaarStand"] = 436598997248, ["ForgeCampWrath"] = 189245161728, ["VeilLashh"] = 459845910784, ["RuuanWeald"] = 105729491200, ["BladesipreHold"] = 173202205952, ["ThunderlordStronghold"] = 292482855168, ["TheSingingRidge"] = 643039488, ["RidgeofMadness"] = 277606721792, ["BladedGulch"] = 158493573376, ["CircleofWrath"] = 225946370304, ["BashirLanding"] = 442761472, ["MokNathalVillage"] = 319591547136, ["Skald"] = 76941623552, ["VeilRuuan"] = 162725495040, ["BloodmaulOutpost"] = 398717134080, ["Sylvanaar"] = 376113002752, ["VortexPinnacle"] = 221365352704, ["Grishnath"] = 30364926208, ["JaggedRidge"] = 444997040384, ["RavensWood"] = 59280458240, ["FelstormPoint"] = 474481152, ["RazorRidge"] = 357041520896, ["ForgeCampAnger"] = 158454776224, ["GruulsLayer"] = 87525949696, ["DeathsDoor"] = 267899014400, ["BrokenWilds"] = 117806727424, ["ForgeCampTerror"] = 446827852288, ["BloodmaulCamp"] = 102437748992, }, ["Ghostlands"] = { ["GoldenmistVillage"] = 46662144, ["ZebNowa"] = 254965890560, ["HowlingZiggurat"] = 235506435328, ["FarstriderEnclave"] = 146629984685, ["DawnstarSpire"] = 603193771, ["WindrunnerVillage"] = 125691232512, ["Deatholme"] = 402753099264, ["SanctumoftheSun"] = 161531560192, ["IsleofTribulations"] = 613679360, ["SuncrownVillage"] = 482607616, ["SanctumoftheMoon"] = 135511933184, ["Tranquillien"] = 2530738432, ["ElrendarCrossing"] = 342098432, ["BleedingZiggurat"] = 255743754496, ["ThalassiaPass"] = 436321130752, ["WindrunnerSpire"] = 308206108928, ["AmaniPass"] = 249735598484, }, ["Zangarmarsh"] = { ["ZabraJin"] = 249291866368, ["AngoroshStronghold"] = 130154752, ["TwinspireRuins"] = 267720589568, ["BloodscaleEnclave"] = 443006845184, ["CoilfangReservoir"] = 97121730816, ["Telredor"] = 120856248576, ["TheDeadMire"] = 138190258462, ["Sporeggar"] = 216917082624, ["CenarionRefuge"] = 345399099700, ["TheHewnBog"] = 54990995712, ["MarshlightLake"] = 163293954304, ["QuaggRidge"] = 349114293504, ["TheLagoon"] = 325880905984, ["UmbrafenVillage"] = 495750167808, ["TheSpawningGlen"] = 364031246592, ["AngoroshGrounds"] = 53779628288, ["OreborHarborage"] = 27189051648, ["FeralfenVillage"] = 356811883008, }, ["BloodmystIsle"] = { ["RuinsofLorethAran"] = 232511504640, ["Bladewood"] = 224797131008, ["VeridianPoint"] = 668205312, ["TheCryoCore"] = 306323915008, ["VindicatorsRest"] = 260089053440, ["KesselsCrossing"] = 566404199909, ["Axxarien"] = 146340577536, ["TheBloodwash"] = 29307961600, ["TheVectorCoil"] = 255596083712, ["WrathscaleLair"] = 363552047360, ["Middenvale"] = 436373553408, ["Nazzivian"] = 434054103296, ["BristlelimbEnclave"] = 440806932736, ["TheFoulPool"] = 146260885760, ["TalonStand"] = 84441039104, ["BloodWatch"] = 277483880704, ["BlacksiltShore"] = 457599863296, ["WyrmscarIsland"] = 88689869056, ["TheLostFold"] = 505186294016, ["BloodcurseIsle"] = 275678232815, ["AmberwebPass"] = 66618654976, ["TheWarpPiston"] = 31611683072, ["RagefeatherRidge"] = 126132420864, ["TelathionsCamp"] = 232117108864, ["TheCrimsonReach"] = 93997760768, ["Mystwood"] = 518941500672, }, ["EversongWoods"] = { ["Zebwatha"] = 510608475264, ["ThuronsLivery"] = 328056570112, ["WestSanctum"] = 342830088320, ["TheGoldenStrand"] = 445795005568, ["GoldenboughPass"] = 503839850752, ["RunestoneShandor"] = 530915178752, ["StillwhisperPond"] = 337652220160, ["RunestoneFalithas"] = 532972482816, ["EastSanctum"] = 400988307712, ["SilvermoonCity"] = 93877436928, ["TranquilShore"] = 320200769792, ["TorWatha"] = 338908513536, ["SunstriderIsle"] = 5573706240, ["TheLivingWood"] = 451507642496, ["NorthSanctum"] = 320353861888, ["TheScortchedGrove"] = 544654622976, ["SatherilsHaven"] = 412656861440, ["SunsailAnchorage"] = 434034049280, ["ElrendarFalls"] = 429031424128, ["RuinsofSilvermoon"] = 146351063296, ["FarstriderRetreat"] = 386022899968, ["FairbreezeVilliage"] = 414869356800, ["DuskwitherGrounds"] = 272291332352, }, ["ShadowmoonValley"] = { ["LegionHold"] = 166539559424, ["NetherwingLedge"] = 478350114284, ["TheHandofGuldan"] = 97050427904, ["IlladarPoint"] = 275028115712, ["WildhammerStronghold"] = 246063488512, ["ShadowmoonVilliage"] = 37703123456, ["NetherwingCliffs"] = 331293655296, ["EclipsePoint"] = 333219994112, ["TheDeathForge"] = 138817306880, ["CoilskarPoint"] = 8955363840, ["TheWardensCage"] = 277517593088, ["TheBlackTemple"] = 135927431564, ["AltarofShatar"] = 100403511552, }, ["TerokkarForest"] = { ["BonechewerRuins"] = 295825572096, ["RaastokGlade"] = 165886034176, ["SkethylMountains"] = 374133293568, ["StonebreakerHold"] = 177583948032, ["CarrionHill"] = 292453351680, ["AllerianStronghold"] = 297930064128, ["GrangolvarVilliage"] = 183760060928, ["RefugeCaravan"] = 288094421120, ["FirewingPoint"] = 160635027841, ["RazorthornShelf"] = 20902576384, ["CenarionThicket"] = 329515264, ["RingofObservance"] = 370766250240, ["ShattrathCity"] = 4404544000, ["VeilRhaze"] = 388927586560, ["TheBoneWastes"] = 287998099968, ["TheBarrierHills"] = 4416864512, ["SethekkTomb"] = 310568550656, ["BleedingHollowClanRuins"] = 323304668416, ["Tuurem"] = 36984848640, }, ["Nagrand"] = { ["LaughingSkullRuins"] = 56202887424, ["ZangarRidge"] = 58272776448, ["TwilightRidge"] = 114901385472, ["Telaar"] = 419165372672, ["KilsorrowFortress"] = 459073111296, ["ForgeCampHate"] = 165526372608, ["RingofTrials"] = 287248220416, ["WindyreedVillage"] = 250880459008, ["ClanWatch"] = 390326386944, ["SouthwindCleft"] = 277435646208, ["ForgeCampFear"] = 266326151680, ["Garadar"] = 153997279488, ["WarmaulHill"] = 34524627200, ["Halaa"] = 207583707392, ["BurningBladeRUins"] = 359322171648, ["ThroneoftheElements"] = 57437061376, ["SunspringPost"] = 213904523520, ["OshuGun"] = 358806272512, ["WindyreedPass"] = 85452914944, }, ['*'] = {} } }) Cartographer.options.args.Foglight = { name = L["Foglight"], desc = L["Module to show unexplored areas on the map."], type = 'group', args = { color = { name = L["Unexplored color"], desc = L["Change the color of the unexplored areas"], type = "color", get = "GetDarkColor", set = "SetDarkColor", hasAlpha = true, }, toggle = { name = AceLibrary("AceLocale-2.2"):new("Cartographer")["Active"], desc = AceLibrary("AceLocale-2.2"):new("Cartographer")["Suspend/resume this module."], type = "toggle", order = -1, get = function() return Cartographer:IsModuleActive(self) end, set = function() Cartographer:ToggleModuleActive(self) end }, }, handler = self, } end function Cartographer_Foglight:OnEnable() self.overlayInfo = self.db.account.errata self:Hook("GetNumMapOverlays", true) self:Hook("WorldMapFrame_Update", true) if WorldMapFrame:IsShown() then WorldMapFrame_Update() end end function Cartographer_Foglight:OnDisable() for i = 1, NUM_WORLDMAP_OVERLAYS do local texture = _G["WorldMapOverlay"..i] texture:Hide() texture:SetVertexColor(1.0,1.0,1.0) texture:SetAlpha(1.0) end if WorldMapFrame:IsShown() then WorldMapFrame_Update() end end function Cartographer_Foglight:GetNumMapOverlays() if NUM_WORLDMAP_OVERLAYS == 0 then return self.hooks.GetNumMapOverlays() end return 0 end function Cartographer_Foglight:WorldMapFrame_Update() self.hooks.WorldMapFrame_Update() self:WorldMapFrame_UpdateOverlays() end local discovered = {} function Cartographer_Foglight:WorldMapFrame_UpdateOverlays() if not WorldMapFrame:IsShown() then return end local mapFileName, textureHeight = GetMapInfo() if not mapFileName then return end local prefix = "Interface\\WorldMap\\"..mapFileName.."\\" local zoneTable = self.overlayInfo[mapFileName] local numOverlays = self.hooks.GetNumMapOverlays() local len = string.len(prefix)+1 for i=1, numOverlays do local tname,tw,th,ofx,ofy = GetMapOverlayInfo(i) tname = string.sub(tname, len) local num = tw + th * 1024 + ofx * 1048576 + ofy * 1073741824 discovered[tname] = num zoneTable[tname] = num end local textureCount = 0 for tname, num in pairs(zoneTable) do local textureName = prefix .. tname local textureWidth, textureHeight, offsetX, offsetY = math_mod(num, 1024), math_mod(math_floor(num / 1024), 1024), math_mod(math_floor(num / 1048576), 1024), math_floor(num / 1073741824) -- HACK: override *known incorrect* data with hard-coded fixes. if textureName == "Interface\\WorldMap\\Tirisfal\\BRIGHTWATERLAKE" then if offsetX == 587 then offsetX = 584 end end if textureName == "Interface\\WorldMap\\Silverpine\\BERENSPERIL" then if offsetY == 417 then offsetY = 415 end end local numTexturesWide = math_ceil(textureWidth / 256) local numTexturesTall = math_ceil(textureHeight / 256) local neededTextures = textureCount + numTexturesWide*numTexturesTall if neededTextures > NUM_WORLDMAP_OVERLAYS then for j = NUM_WORLDMAP_OVERLAYS+1, neededTextures do WorldMapDetailFrame:CreateTexture("WorldMapOverlay"..j, "ARTWORK") end NUM_WORLDMAP_OVERLAYS = neededTextures end for j = 1, numTexturesTall do local texturePixelHeight local textureFileHeight if j < numTexturesTall then texturePixelHeight = 256 textureFileHeight = 256 else texturePixelHeight = math_mod(textureHeight, 256) if texturePixelHeight == 0 then texturePixelHeight = 256 end textureFileHeight = 16 while textureFileHeight < texturePixelHeight do textureFileHeight = textureFileHeight * 2 end end for k = 1, numTexturesWide do if textureCount > NUM_WORLDMAP_OVERLAYS then return end textureCount = textureCount + 1 local texture = _G["WorldMapOverlay"..textureCount] if k < numTexturesWide then texturePixelWidth = 256 textureFileWidth = 256 else texturePixelWidth = math_mod(textureWidth, 256) if texturePixelWidth == 0 then texturePixelWidth = 256 end textureFileWidth = 16 while textureFileWidth < texturePixelWidth do textureFileWidth = textureFileWidth * 2 end end texture:SetWidth(texturePixelWidth) texture:SetHeight(texturePixelHeight) texture:SetTexCoord(0, texturePixelWidth/textureFileWidth, 0, texturePixelHeight/textureFileHeight) texture:ClearAllPoints() texture:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", offsetX + (256 * (k-1)), -(offsetY + (256 * (j - 1)))) texture:SetTexture(textureName..(((j - 1) * numTexturesWide) + k)) if discovered[tname] then texture:SetVertexColor(1.0,1.0,1.0) texture:SetAlpha(1.0) else texture:SetVertexColor(self.db.profile.darkR, self.db.profile.darkG, self.db.profile.darkB) texture:SetAlpha(self.db.profile.darkA) end texture:Show() end end end for i = textureCount+1, NUM_WORLDMAP_OVERLAYS do _G["WorldMapOverlay"..i]:Hide() end for k in pairs(discovered) do discovered[k] = nil end end function Cartographer_Foglight:GetDarkColor() return self.db.profile.darkR, self.db.profile.darkG, self.db.profile.darkB, self.db.profile.darkA end function Cartographer_Foglight:SetDarkColor(r,g,b,a) if WorldMapFrame:IsShown() and WorldMapFrame:GetFrameStrata() == "FULLSCREEN" then ToggleWorldMap() end self.db.profile.darkR, self.db.profile.darkG, self.db.profile.darkB, self.db.profile.darkA = r,g,b,a self:WorldMapFrame_UpdateOverlays() end function Cartographer_Foglight:OnProfileEnable() WorldMapFrame_Update() end
gpl-3.0
Telewildv4/Telewildv4bot
plugins/google.lua
336
1323
do local function googlethat(query) local url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&safe=active&&rsz=5&' local parameters = 'q='..(URL.escape(query) or '') -- Do the request local res, code = https.request(url..parameters) if code ~=200 then return nil end local data = json:decode(res) local results = {} for key,result in ipairs(data.responseData.results) do table.insert(results, { result.titleNoFormatting, result.unescapedUrl or result.url }) end return results end local function stringlinks(results) local stringresults='' i = 0 for key,val in ipairs(results) do i = i+1 stringresults=stringresults..i..'. '..val[1]..'\n'..val[2]..'\n' end return stringresults end local function run(msg, matches) -- comment this line if you want this plugin works in private message. if not is_chat_msg(msg) then return nil end local results = googlethat(matches[1]) return stringlinks(results) end return { description = 'Returns five results from Google. Safe search is enabled by default.', usage = ' !google [terms]: Searches Google and send results', patterns = { '^!google (.*)$', '^%.[g|G]oogle (.*)$' }, run = run } end
gpl-2.0
EvilHero90/forgottenserver
data/scripts/monsters/cobra_flask.lua
5
1162
local cobras = {"cobra scout", "cobra vizier", "cobra assassin"} local ev = EventCallback function ev.onSpawn(monster, position, startup, artificial) if table.contains(cobras, monster:getName():lower()) then local storage = Game.getStorageValue(GlobalStorageKeys.cobraBastionFlask) if storage then if storage >= os.time() then monster:setHealth(monster:getMaxHealth() * 0.75) monster:getPosition():sendMagicEffect(CONST_ME_GREEN_RINGS) else Game.setStorageValue(GlobalStorageKeys.cobraBastionFlask, -1) end end end return true end ev:register(-1) local cobraFlask = Action() function cobraFlask.onUse(player, item, fromPosition, target, toPosition, isHotkey) if table.contains({33940, 33941, 33942, 33943}, target:getId()) then target:getPosition():sendMagicEffect(CONST_ME_GREENSMOKE) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You carefully pour just a tiny, little, finely dosed... and there goes the whole content of the bottle. Stand back!") item:transform(33953) Game.setStorageValue(GlobalStorageKeys.cobraBastionFlask, os.time() + 30 * 60) end return true end cobraFlask:id(33952) cobraFlask:register()
gpl-2.0
ahnqirage/thrift
lib/lua/TTransport.lua
115
2800
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you may not use this file except in compliance -- with the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, -- software distributed under the License is distributed on an -- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -- KIND, either express or implied. See the License for the -- specific language governing permissions and limitations -- under the License. -- require 'Thrift' TTransportException = TException:new { UNKNOWN = 0, NOT_OPEN = 1, ALREADY_OPEN = 2, TIMED_OUT = 3, END_OF_FILE = 4, INVALID_FRAME_SIZE = 5, INVALID_TRANSFORM = 6, INVALID_CLIENT_TYPE = 7, errorCode = 0, __type = 'TTransportException' } function TTransportException:__errorCodeToString() if self.errorCode == self.NOT_OPEN then return 'Transport not open' elseif self.errorCode == self.ALREADY_OPEN then return 'Transport already open' elseif self.errorCode == self.TIMED_OUT then return 'Transport timed out' elseif self.errorCode == self.END_OF_FILE then return 'End of file' elseif self.errorCode == self.INVALID_FRAME_SIZE then return 'Invalid frame size' elseif self.errorCode == self.INVALID_TRANSFORM then return 'Invalid transform' elseif self.errorCode == self.INVALID_CLIENT_TYPE then return 'Invalid client type' else return 'Default (unknown)' end end TTransportBase = __TObject:new{ __type = 'TTransportBase' } function TTransportBase:isOpen() end function TTransportBase:open() end function TTransportBase:close() end function TTransportBase:read(len) end function TTransportBase:readAll(len) local buf, have, chunk = '', 0 while have < len do chunk = self:read(len - have) have = have + string.len(chunk) buf = buf .. chunk if string.len(chunk) == 0 then terror(TTransportException:new{ errorCode = TTransportException.END_OF_FILE }) end end return buf end function TTransportBase:write(buf) end function TTransportBase:flush() end TServerTransportBase = __TObject:new{ __type = 'TServerTransportBase' } function TServerTransportBase:listen() end function TServerTransportBase:accept() end function TServerTransportBase:close() end TTransportFactoryBase = __TObject:new{ __type = 'TTransportFactoryBase' } function TTransportFactoryBase:getTransport(trans) return trans end
apache-2.0
Oliveryo/Interface
AddOns/VanillaGuide/GuideTables/Alliance/002_ElwynnForest.lua
1
15073
--[[-------------------------------------------------- 002_ElwynnForest.lua Authors: mrmr Version: 1.04.2 ------------------------------------------------------ Description: Guide Serie - 001 Elwynn Forest 1.04.1 -- First Release Human Elwynn Forest's Guide from level 1 to lever 12 1.04.2 -- no changes in here for this revision ------------------------------------------------------ Connection: --]]-------------------------------------------------- Table_002_ElwynnForest = { -----------1-10 Elwynn Forest --[15] = { [0110] = { title = "1-10 Elwynn Forest", --n = "1-10 Elwynn Forest", --pID = 1, nID = 16, --itemCount = 69, items = { [1] = { str = "1-10 Elwynn Forest" }, [2] = { str = "Directly in front of where you start accept A Threat Within then go in the building and turn it in, accept Kobold Camp Cleanup" }, [3] = { str = "Run back out, and turn in Welcome! at the wagons at 47,41", x = 47, y = 41, zone = "Elwynn Forest" }, [4] = { str = "Go to the nook at the NW corner of the building at 48,40 and accept Wolves Across the Border", x = 48, y = 40, zone = "Elwynn Forest" }, [5] = { str = "Kill the wolves all in front of you for Wolves Across the Border while working your way to the kobold vermin at 47,35 for Kobold Camp Cleanup", x = 47, y = 35, zone = "Elwynn Forest" }, [6] = { str = "Go back to 48,40 and turn in Wolves Across the Border", x = 48, y = 40, zone = "Elwynn Forest" }, [7] = { str = "Run into the house at 48,41 and turn in Kobold Camp Cleanup accept Simple Letter and Investigate Echo Ridge", x = 48, y = 41, zone = "Elwynn Forest" }, [8] = { str = "Go to the warrior trainer at 50,42 and turn in Simple Letter and train", x = 50, y = 42, zone = "Elwynn Forest" }, [9] = { str = "Exit the house and grab Brotherhood of Thieves just outside" }, [10] = { str = "Go NW toward the cave at 47,32 and kill kobold workers on the way up tp it for Investigate Echo Ridge", x = 47, y = 32, zone = "Elwynn Forest" }, [11] = { str = "Go West to 54,40 and go south killing the defias until you finish Brotherhood of Thieves you should have dinged 4 by the time you’re done, if not just kill until you are", x = 54, y = 40, zone = "Elwynn Forest" }, [12] = { str = "Run back to the abbey at 48,42 and turn in Brotherhood of Thieves accept Milly Osworth and Bounty on Garrick Padfoot", x = 48, y = 42, zone = "Elwynn Forest" }, [13] = { str = "Go inside the house and turn in Investigate Echo Ridge accept Skirmish at Echo Ridge then get new skills" }, [14] = { str = "Go north of the house at 50,39 next to the barn, turn in Milly Osworth accept Milly's Harvest", x = 50, y = 39, zone = "Elwynn Forest" }, [15] = { str = "Go back east and grab the grapes in the garden at 54,48 for Milly's Harvest then NE to 57,48 you’ll see a shack with padfoot and a thug. Kill him for Bounty on Garrick Padfoot", x = 57, y = 48, zone = "Elwynn Forest" }, [16] = { str = "Go back to 50,39 and turn in Milly's Harvest accept Grape Manifest", x = 50, y = 39, zone = "Elwynn Forest" }, [17] = { str = "Go into the cave at 47,31 and kill kobold laborer’s for Skirmish at Echo Ridge", x = 47, y = 31, zone = "Elwynn Forest" }, [18] = { str = "Hearth back to the Abbey" }, [19] = { str = "Turn in Bounty on Garrick Padfoot right in front of you" }, [20] = { str = "Go inside the house, turn in Skirmish at Echo Ridge accept Report to Goldshire" }, [21] = { str = "Go to the top of the tower through the spiral staircase, turn in Grape Manifest" }, [22] = { str = "Go to 45,47 and accept Rest and Relaxation", x = 45, y = 47, zone = "Elwynn Forest" }, [23] = { str = "If you’re not 6 you should be close, just grind on a few mobs while you head towards the house near goldshire at 46,62 and pick up skinning if you want it", x = 46, y = 42, zone = "Elwynn Forest" }, [24] = { str = "Reach goldshire and enter the Inn at 42,65", x = 42, y = 65, zone = "Elwynn Forest" }, [25] = { str = "Just to your left accept Kobold Candles" }, [26] = { str = "Near the bar turn in Rest and Relaxation and make Goldshire your home" }, [27] = { str = "Exit the Inn and go straight out, turn in Report to Goldshire accept The Fargodeep Mine" }, [28] = { str = "Get your new skills in town here." }, [29] = { str = "Go near the carts at 42,67 and accept Gold Dust Exchange", x = 42, y = 67, zone = "Elwynn Forest" }, [30] = { str = "Go south to the Fargodeep Mine at 39,82 and kill the kobold until you complete all 3 quests The Fargodeep Mine, Gold Dust Exchange, and Kobold Candles Make sure you go in the lower entrance so The Fargodeep Mine is easier", x = 39, y = 82, zone = "Elwynn Forest" }, [31] = { str = "Once all 3 are done go to the stonefield farm just up the hill east at 34,84 and accept Lost Necklace SKIP Princess Must Die! it’s just too hard to do alone.", x = 34, y = 84, zone = "Elwynn Forest" }, [32] = { str = "Go east to the Maclure Vinyard at 43,80 and accept Young Lovers", x = 43, y = 80, zone = "Elwynn Forest" }, [33] = { str = "Go to 43,85 and turn in Lost Necklace accept Pie For Billy then turn around and kill boars until it’s finished.", x = 43, y = 85, zone = "Elwynn Forest" }, [34] = { str = "Go back west to 34,84 and turn in Pie For Billy and accept Back to Billy", x = 34, y = 84, zone = "Elwynn Forest" }, [35] = { str = "Go west some to the river at 29,85 and turn in Young Lovers accept Speak with Gramma", x = 29, y = 85, zone = "Elwynn Forest" }, [36] = { str = "Go back to 34,84 and turn in Speak with Gramma in the house, accept Note to William", x = 34, y = 84, zone = "Elwynn Forest" }, [37] = { str = "Run back east to 43,85 and turn in Back to Billy accept Goldtooth", x = 43, y = 85, zone = "Elwynn Forest" }, [38] = { str = "Go in the bottom entrance of the fargodeep mine at 39,82 and to about 41,78 inside and kill goldtooth for Goldtooth You should ding 7 sometime in the cave or before you came in.", x = 41, y = 78, zone = "Elwynn Forest" }, [39] = { str = "Hearth back to Goldshire" }, [40] = { str = "In the Inn turn in Kobold Candles accept Shipment to Stormwind also turn in Note to William accept Collecting Kelp" }, [41] = { str = "Straight outside the Inn, turn in The Fargodeep Mine accept The Jasperlode Mine" }, [42] = { str = "South near the fence, turn in Gold Dust Exchange You should have dinged lvl 7 now, accept A Fishy Peril" }, [43] = { str = "Turn around by the blacksmith and turn it in, accept Further Concerns" }, [44] = { str = "Kill murlocs around the lake at 51,65 for Collecting Kelp", x = 51, y = 65, zone = "Elwynn Forest" }, [45] = { str = "Grind up to the Jasperlode mine at 61,53 and run through it about half way to 60,50 for The Jasperlode Mine", x = 60, y = 50, zone = "Elwynn Forest" }, [46] = { str = "Run to the bridge at 73,72 and turn in Further Concerns accept Find the Lost Guards and Protect the Frontier", x = 73, y = 72, zone = "Elwynn Forest" }, [47] = { str = "Stop at the house NE of here at 79,68 and accept Red Linen Goods", x = 79, y = 68, zone = "Elwynn Forest" }, [48] = { str = "At the center of the camp, 81,66, accept A Bundle of Trouble", x = 81, y = 66, zone = "Elwynn Forest" }, [49] = { str = "Run just west of the waterfall at 72,60 touch the mangled body and turn in Find the Lost Guards accept Discover Rolf’s Fate if this doesn’t make you ding 8 then grind that last tiny bit.", x = 72, y = 60, zone = "Elwynn Forest" }, [50] = { str = "Go to the murloc camp at 79,55 and loot the mangled body there (might need a group, but usually always people here) and turn in Discover Rolf’s Fate accept Report to Thomas", x = 79, y = 55, zone = "Elwynn Forest" }, [51] = { str = "Go south to 81,66 and turn in “A Bundle of Trouble”", x = 81, y = 66, zone = "Elwynn Forest" }, [52] = { str = "Cross the road and go south and east and finish killing the bears and wolves for “Protect the Frontier” bears are kinda scarce so you might have to search." }, [53] = { str = "While doing this you can get some, if not all, of the red bandannas for Red Linen Goods at 90,78", x = 90, y = 78, zone = "Elwynn Forest" }, [54] = { str = "Go back to 73,72 near the bridge and turn in “Protect the Frontier” and “Report to Thomas” acept “Deliver Thomas' Report”", x = 73, y = 72, zone = "Elwynn Forest" }, [55] = { str = "Go down to the pumpkin patch at 69,78 and kill the rest of the defias for Red Linen Goods ", x = 69, y = 78, zone = "Elwynn Forest" }, [56] = { str = "You might find Furlbrow's Deed on the defias while you’re killing defias just hold it for now." }, [57] = { str = "Go to 79,68 and turn in Red Linen Goods it should make you lvl 9 or bring you really close", x = 79, y = 68, zone = "Elwynn Forest" }, [58] = { str = "Stop at the bridge again at 73,72 and accept “Report to Gryan Stoutmantle” must be 9 to accept", x = 73, y = 72, zone = "Elwynn Forest" }, [59] = { str = "Hearth to Goldshire" }, [60] = { str = "By the front door turn in “Collecting Kelp” accept “The Escape”" }, [61] = { str = "Just outside the Inn turn in “The Jasperlode Mine” and “Deliver Thomas' Report” SKIPt “Cloth and Leather Armor” accept “Westbrook Garrison Needs Help!”" }, [62] = { str = "In the blacksmith house right here accept “Elmore's Task” then get training" }, [63] = { str = "Run south to the maclure vinyard at 43,89 and turn in “The Escape”", x = 43, y = 89, zone = "Elwynn Forest" }, [64] = { str = "Run west to the stonefield farm at 34,84 and turn in “Goldtooth”", x = 34, y = 84, zone = "Elwynn Forest" }, [65] = { str = "Go NW to 34,74 and turn in “Westbrook Garrison Needs Help!” accept “Riverpaw Gnoll Bounty” You will also see the wanted poster and it’s the famous old hogger quest. He’s a tough lvl 11 elite and is not easy so skip it, unless you have a group it’s up to you. Remember on new servers you’re probably still within range of everyone so it shouldn’t be hard to get done.", x = 34, y = 74, zone = "Elwynn Forest" }, [66] = { str = "Go just south of the road and start killing gnolls for “Riverpaw Gnoll Bounty” they can also drop a gold schedule which starts a quest" }, [67] = { str = " Go back up to 34,74 and turn in “Riverpaw Gnoll Bounty” ", x = 34, y = 74, zone = "Elwynn Forest" }, [68] = { str = "You should be very close to 10 now." }, [69] = { str = "Follow the road west into Westfall" }, } }, -----------10-12 Westfall and Lock Modan --[16] = { [1012] = { title = "10-12 Westfall and Lock Modan", --n = "10-12 Westfall and Lock Modan", --pID = 15, nID = 101, --itemCount = 34, items = { [1] = { str = "10-12 Westfall and Lock Modan" }, [2] = { str = "Go to 59,19 and turn in “Furlbrow’s Deed” if you found it before", x = 59, y = 19, zone = "Westfall" }, [3] = { str = "Accept “Westfall Stew” SKIP “Poor Old Blanchy”" }, [4] = { str = "Go in the house at 56,30 and turn in “Westfall Stew”", x = 56, y = 30, zone = "Westfall" }, [5] = { str = "Go to 56,47 and turn in “Report to Gryan Stoutmantle”", x = 56, y = 47, zone = "Westfall" }, [6] = { str = "Go in the tower and accept “A Swift Message”" }, [7] = { str = "Get the FP at 56,52 and turn in “A Swift Message” accept “Continue to Stormwind”", x = 56, y = 52, zone = "Westfall" }, [8] = { str = "Fly to SW unless you did hogger, then hearth to Goldshire and turn it in outside the Inn then train" }, [9] = { str = "In SW go to 56,64 and turn in “Shipment to Stormwind”", x = 56, y = 64, zone = "Stormwind" }, [10] = { str = "Train new weapons at 57,57", x = 57, y = 57, zone = "Stormwind" }, [11] = { str = "Go to 74,47 and turn in “Continue to Stormwind” accept “Dungar Longdrink”", x = 74, y = 47, zone = "Stormwind" }, [12] = { str = "Go to 51,12 and turn in “Elmore's Task” accept “Stormpike's Delivery” this will be done on the way to the wetlands", x = 51, y = 12, zone = "Stormwind" }, [13] = { str = "Go to 78,45 and accept “A Warrior’s Training” or your classes lvl 10 quest.", x = 78, y = 45, zone = "Stormwind" }, [14] = { str = "Go to 66,62 and turn in “Stormpike's Delivery” accept “Return to Lewis” then fly back to Westfall", x = 66, y = 62, zone = "Stormwind" }, [15] = { str = "Go to the tower at 56,47 and turn in “Return to Lewis” super easy xp", x = 56, y = 47, zone = "Westfall" }, [16] = { str = "Fly back to SW Go in the bar at 74,37 and turn in “A Warrior’s Training” accept “Bartleby the Drunk” then turn around and hand it in accept “Beat Bartleby", x = 74, y = 37, zone = "Stormwind" }, [17] = { str = "Kick bartleby’s ass then talk to him again and accept “Bartleby's Mug” then turn it in behind you and learn your defense" }, [18] = { str = "Go into the tram at 63,8 and take it to IF", x = 63, y = 8, zone = "Stormwind" }, [19] = { str = "Once it stops accept “Deeprun Rat Roundup” just collect 5 rats and turn it in. You could skip this and keep the flute, It can really piss people off if you play it non stop around the IF bank. SKIP “Me Brother, Nipsy” unless you go back to SW on the tram because you get crap xp" }, [20] = { str = "Grab the FP at 55,47", x = 55, y = 47, zone = "Ironforge" }, [21] = { str = "After the rat quest you should be real close to 11" }, [22] = { str = "Leave IF and head into Dun Morogh" }, [23] = { str = "Run east to 68,55 and accept “The Public Servant”", x = 68, y = 55, zone = "Dun Morogh" }, [24] = { str = "Go behind him and accept “Those Blasted Troggs!”" }, [25] = { str = "Go in the pidd below and kill the troggs here and in the cave for both quests then turn them back in at 68,55", x = 68, y = 55, zone = "Dun Morogh" }, [26] = { str = "Go east to 80,51 and follow the path into Loch Modan", x = 80, y = 51, zone = "Dun Morogh" }, [27] = { str = " Go to 22,73 and accept In Defense of the King's Lands”", x = 22, y = 73, zone = "Loch Modan" }, [28] = { str = "Go up in the tower and accept The Trogg Threat" }, [29] = { str = "At 33,50 grab the FP", x = 33, y = 50, zone = "Loch Modan" }, [30] = { str = "Look for the wandering guidrd and accept “Rat Catching”" }, [31] = { str = "Kill troggs from 27,53 and north for In Defense of the King's Lands” and The Trogg Threat", x = 27, y = 53, zone = "Loch Modan" }, [32] = { str = "Go back to 22,73 and turn them both in", x = 22, y = 73, zone = "Loch Modan" }, [33] = { str = "Go north to the tower at 24,18 and turn in “Stormpike's Delivery”", x = 24, y = 18, zone = "Loch Modan" }, [34] = { str = "You should be 12 now or close to it. You can grind if you’d like but it doesn’t matter much. Follow the Night Elf to IF guide but just go backwards. You’re going to go north through the wetlands to menethil, then boat to auberdine from here." }, } }, }
gpl-3.0
Flexibity/luci
modules/admin-core/luasrc/tools/status.lua
8
3115
--[[ LuCI - Lua Configuration Interface Copyright 2011 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- module("luci.tools.status", package.seeall) local uci = require "luci.model.uci".cursor() function dhcp_leases() local rv = { } local nfs = require "nixio.fs" local leasefile = "/var/dhcp.leases" uci:foreach("dhcp", "dnsmasq", function(s) if s.leasefile and nfs.access(s.leasefile) then leasefile = s.leasefile return false end end) local fd = io.open(leasefile, "r") if fd then while true do local ln = fd:read("*l") if not ln then break else local ts, mac, ip, name = ln:match("^(%d+) (%S+) (%S+) (%S+)") if ts and mac and ip and name then rv[#rv+1] = { expires = os.difftime(tonumber(ts) or 0, os.time()), macaddr = mac, ipaddr = ip, hostname = (name ~= "*") and name } end end end fd:close() end return rv end function wifi_networks() local rv = { } local ntm = require "luci.model.network".init() local dev for _, dev in ipairs(ntm:get_wifidevs()) do local rd = { up = dev:is_up(), device = dev:name(), name = dev:get_i18n(), networks = { } } local net for _, net in ipairs(dev:get_wifinets()) do rd.networks[#rd.networks+1] = { name = net:shortname(), link = net:adminlink(), up = net:is_up(), mode = net:active_mode(), ssid = net:active_ssid(), bssid = net:active_bssid(), encryption = net:active_encryption(), frequency = net:frequency(), channel = net:channel(), signal = net:signal(), quality = net:signal_percent(), noise = net:noise(), bitrate = net:bitrate(), ifname = net:ifname(), assoclist = net:assoclist(), country = net:country(), txpower = net:txpower(), txpoweroff = net:txpower_offset() } end rv[#rv+1] = rd end return rv end function wifi_network(id) local ntm = require "luci.model.network".init() local net = ntm:get_wifinet(id) if net then local dev = net:get_device() if dev then return { id = id, name = net:shortname(), link = net:adminlink(), up = net:is_up(), mode = net:active_mode(), ssid = net:active_ssid(), bssid = net:active_bssid(), encryption = net:active_encryption(), frequency = net:frequency(), channel = net:channel(), signal = net:signal(), quality = net:signal_percent(), noise = net:noise(), bitrate = net:bitrate(), ifname = net:ifname(), assoclist = net:assoclist(), country = net:country(), txpower = net:txpower(), txpoweroff = net:txpower_offset(), device = { up = dev:is_up(), device = dev:name(), name = dev:get_i18n() } } end end return { } end
apache-2.0
mcastron/TinyBRL
scripts/lua_scripts/makeInit.lua
3
2837
local agents = require "data.agents" local gridComputing = require "data.gridComputing" local formulaSets = require "data.formula_sets" local experiments_accurate = require "data.experiments_accurate" local experiments_inaccurate = require "data.experiments_inaccurate" local experiments_options = require "data.experiments_options" local experiments = { options = experiments_options } for _, exp in ipairs(experiments_accurate) do table.insert(experiments, exp) end for _, exp in ipairs(experiments_inaccurate) do table.insert(experiments, exp) end -- Extra functions function getTab(n) local str = "" for i = 0, n do str = str .. " " end return str end -- Main program -- Generate the commands -- Formulas sets print() for _, fSet in ipairs(formulaSets) do print("./BBRL-DDS --formula_set_generation \\") print(getTab(1) .. "--n_variables " .. fSet.nVariables .. " \\") tokensStr = "--tokens " .. #(fSet.tokens) for _, token in ipairs(fSet.tokens) do tokensStr = tokensStr .. " " .. token end print(getTab(1) .. tokensStr .. " \\") print(getTab(1) .. "--max_size " .. fSet.maxSize .. " \\") print(getTab(1) .. "--reduce --n_points " .. fSet.nPoints .. " --points_range " .. fSet.pointsRange[1] .. " " .. fSet.pointsRange[2] .. " \\") print(getTab(1) .. "--output \"data/formula_sets/" .. fSet.name .. ".dat\"") print() end -- Experiments print() for _, exp in ipairs(experiments) do alreadyDone = false for _, expBis in ipairs(experiments) do if (expBis == exp) then break end if (expBis.exp == exp.exp and expBis.testFile == exp.testFile and expBis.N == exp.N and expBis.gamma == exp.gamma and expBis.T == exp.T) then alreadyDone = true break end end if (not alreadyDone) then print("./BBRL-DDS --new_experiment \\") print(getTab(1) .. "--name \"" .. exp.exp .. " Experiment\" \\") print(getTab(1) .. "--mdp_distribution \"DirMultiDistribution\" \\") print(getTab(2) .. "--mdp_distribution_file \"data/distributions/" .. exp.testFile .. "\" \\") print(getTab(1) .. "--n_mdps " .. exp.N .. " \\") print(getTab(1) .. "--n_simulations_per_mdp 1 \\") print(getTab(1) .. "--discount_factor " .. exp.gamma .. " \\") print(getTab(1) .. "--horizon_limit " .. exp.T .. " \\") print(getTab(1) .. "--compress_output \\") print(getTab(1) .. "--output \"data/experiments/" .. exp.exp .. exp.N .. "-exp.dat" .. "\"") print() end end
gpl-2.0
Spring-SpringBoard/SpringBoard-Core
scen_edit/command/terrain_change_texture_command.lua
1
1107
TerrainChangeTextureCommand = Command:extends{} TerrainChangeTextureCommand.className = "TerrainChangeTextureCommand" function TerrainChangeTextureCommand:init(opts) self.opts = opts self.mergeCommand = "TerrainChangeTextureMergedCommand" end function TerrainChangeTextureCommand:execute() local cmd = WidgetTerrainChangeTextureCommand(self.opts) SB.commandManager:execute(cmd, true) end function TerrainChangeTextureCommand:unexecute() -- handled by the merged command end TerrainChangeTextureMergedCommand = CompoundCommand:extends{} TerrainChangeTextureMergedCommand.className = "TerrainChangeTextureMergedCommand" function TerrainChangeTextureMergedCommand:unexecute() -- one unexecute is enough (do it better) local cmd = WidgetUndoTerrainChangeTextureCommand() SB.commandManager:execute(cmd, true) end function TerrainChangeTextureMergedCommand:execute() self:super("execute") self:onMerge() end function TerrainChangeTextureMergedCommand:onMerge() local cmd = WidgetTerrainChangeTexturePushStackCommand() SB.commandManager:execute(cmd, true) end
mit
Oliveryo/Interface
AddOns/enemyFrames/globals/settings/optionals.lua
1
2651
------------------------------------------------------------------------------- local settings = _G['enemyFramesSettings'] local container = CreateFrame('Frame', 'enemyFramesSettingsoptionalsContainer', settings) container:SetWidth(settings:GetWidth()) container:SetHeight(settings:GetHeight()) container:SetPoint('CENTER', settings) container:EnableMouse(true) container:EnableMouseWheel(true) container:Hide() ------------------------------------------------------------------------------- local checkBoxOptionalsN, checkBoxOptionals = 5, { [1] = {['id'] = 'displayNames', ['label'] = 'Display names'}, --[2] = {['id'] = 'displayHealthValues', ['label'] = 'Display Health %'}, [2] = {['id'] = 'displayManabar', ['label'] = 'Display mana bar'}, [3] = {['id'] = 'castTimers', ['label'] = 'Display cast timers'}, [4] = {['id'] = 'displayOnlyNearby', ['label'] = 'Display nearby units only'}, [5] = {['id'] = 'targetCounter', ['label'] = 'Display Target Counter'}, } ------------------------------------------------------------------------------- -- optionals container.optionals = container:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') container.optionals:SetPoint('LEFT', container, 'TOPLEFT', 45, -30) container.optionals:SetText'optional' container.optinalsList = {} for i = 1, checkBoxOptionalsN, 1 do container.optinalsList[i] = CreateFrame('CheckButton', 'enemyFramesOptionalsCheckButton'..i, container, 'UICheckButtonTemplate') container.optinalsList[i]:SetHeight(20) container.optinalsList[i]:SetWidth(20) container.optinalsList[i]:SetPoint('LEFT', i == 1 and container.optionals or container.optinalsList[i-1], 'LEFT', 0, i == 1 and -40 or -30) _G[container.optinalsList[i]:GetName()..'Text']:SetText(checkBoxOptionals[i]['label']) _G[container.optinalsList[i]:GetName()..'Text']:SetPoint('LEFT', container.optinalsList[i], 'RIGHT', 4, 0) container.optinalsList[i].id = checkBoxOptionals[i]['id'] container.optinalsList[i]:SetScript('OnClick', function() ENEMYFRAMESPLAYERDATA[this.id] = this:GetChecked() ENEMYFRAMESsettings() end) end ------------------------------------------------------------------------------- OPTIONALSSETTINGSInit = function(color) for i = 1, checkBoxOptionalsN do _G[container.optinalsList[i]:GetName()..'Text']:SetTextColor(color['r'], color['g'], color['b'], .9) container.optinalsList[i]:SetChecked(ENEMYFRAMESPLAYERDATA[checkBoxOptionals[i]['id']]) end end -------------------------------------------------------------------------------
gpl-3.0
weirdouncle/QSanguosha-For-Hegemony
lua/ai/chat-ai.lua
1
21506
--[[******************************************************************** Copyright (c) 2013-2014 - QSanguosha-Rara This file is part of QSanguosha-Hegemony. This game is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. See the LICENSE file for more details. QSanguosha-Rara *********************************************************************]] sgs.ai_chat = {} function speak(to, type) if not sgs.GetConfig("AIChat", false) then return end if to:getState() ~= "robot" then return end if sgs.GetConfig("OriginAIDelay", 0) == 0 then return end if table.contains(sgs.ai_chat, type) then local i = math.random(1, #sgs.ai_chat[type]) to:speak(sgs.ai_chat[type][i]) end end function speakTrigger(card, from, to, event) if sgs.GetConfig("OriginAIDelay", 0) == 0 then return end if type(to) == "table" then for _, t in ipairs(to) do speakTrigger(card, from, t, event) end return end if (event == "death") and from:hasShownSkill("ganglie") then speak(from, "ganglie_death") end if not card then return end if card:isKindOf("Indulgence") and (to:getHandcardNum() > to:getHp()) then speak(to, "indulgence") elseif card:isKindOf("LeijiCard") then speak(from, "leiji_jink") elseif card:isKindOf("QuhuCard") then speak(from, "quhu") elseif card:isKindOf("Slash") and to:hasShownSkill("yiji") and (to:getHp() <= 1) then speak(to, "guojia_weak") elseif card:isKindOf("SavageAssault") and (to:hasShownSkill("kongcheng") or to:hasShownSkill("huoji")) then speak(to, "daxiang") elseif card:isKindOf("FireAttack") and to:hasShownSkill("luanji") then speak(to, "yuanshao_fire") elseif card:isKindOf("Peach") and math.random() < 0.1 then speak(to, "usepeach") end end sgs.ai_chat_func[sgs.SlashEffected].blindness = function(self, player, data) if player:getState() ~= "robot" then return end local effect = data:toSlashEffect() if not effect.from then return end local chat = {"队长,是我,别开枪,自己人.", "尼玛你杀我,你真是夏侯惇啊", "再杀我一下,老子和你拼命了", "信不信等下我砍死你" } if self:hasCrossbowEffect(effect.from) then table.insert(chat, "杀得我也是醉了。。。") table.insert(chat, "果然是连弩降智商呀。") table.insert(chat, "杀死我也没牌拿,真2") end if effect.from:getMark("drank") > 0 then table.insert(chat, "喝醉了吧,乱砍人?") end if sgs.isAnjiang(effect.to) then table.insert(chat, "尼玛眼瞎了,老子是和你一伙的") table.insert(chat, "老大别打我,我现在不方便暴露") table.insert(chat, "别再杀我,你会裸") table.insert(chat, "盲狙一时爽啊, 我泪奔啊") table.insert(chat, "我次奥,哥们,盲狙能不能轻点?") if not sgs.isAnjiang(effect.from) and effect.from:getRole() ~= "careerist" then table.insert(chat, "杀你妹啊,我也是" .. sgs.Sanguosha:translate(effect.from:getKingdom())) end end local index = 1 + (os.time() % #chat) if os.time() % 10 <= 3 and not effect.to:isLord() and math.random() < 0.9 then effect.to:speak(chat[index]) end end sgs.ai_chat_func[sgs.Death].stupid_friend = function(self, player, data) if player:getState() ~= "robot" then return end local damage = data:toDeath().damage local chat = {"2B了吧,老子和你是一伙的还杀我", "你这个逼装得太厉害了", "房主下盘T了这个2货,拉黑不解释", "还有更2的吗", "真的很无语", } if damage and damage.from and player:isFriendWith(damage.from) and damage.to:objectName() == player:objectName() and ((not damage.card) or (damage.card:getSkillName() ~= "lijian")) then local index = 1 + (os.time() % #chat) damage.to:speak(chat[index]) end end --[[ sgs.ai_chat_func[sgs.Dying].fuck_renegade = function(self, player, data) local dying = data:toDying() local chat = {"小内,你还不跳啊,要崩盘吧", "9啊,不9就输了", "999...999...", "小内,我死了,你也赢不了", "没戏了,小内不帮忙的话,我们全部托管吧", } if (self.role=="rebel" or self.role == "loyalist") and sgs.current_mode_players["renegade"] > 0 and dying.who:objectName() == player:objectName() then local index = 1 + (os.time() % #chat) player:speak(chat[index]) end end ]] sgs.ai_chat_func[sgs.EventPhaseStart].ally = function(self, player, data) if player:getState() ~= "robot" then return end if player:getPhase() == sgs.Player_Play then local gameProcess = sgs.gameProcess() if string.find(gameProcess, ">>>") then local kingdom = gameProcess:split(">")[1] if player:getKingdom() == kingdom then return end kingdom = sgs.Sanguosha:translate(kingdom) local chat = { "现在" .. kingdom .. "国比较猖狂,我们应该联合起来", "不要乱砍了,砍" .. kingdom .. "的" } if os.time() % 10 < 1 then player:speak(chat[math.random(1, #chat)]) end end end end sgs.ai_chat_func[sgs.EventPhaseStart].comeon = function(self, player, data) if player:getState() ~= "robot" then return end local chat = {"有货,可以来搞一下", "看我眼色行事", "没闪, 不要乱来", "不爽,来啊!砍我啊", "求杀求砍求蹂躏", } if player:getPhase() == sgs.Player_Finish and not player:isKongcheng() and player:hasShownSkill("leiji") and os.time() % 10 < 4 then local index = 1 + (os.time() % #chat) player:speak(chat[index]) end end sgs.ai_chat_func[sgs.EventPhaseStart].beset = function(self, player, data) if player:getState() ~= "robot" then return end local chat = { "大家一起围观一下", "不要一下弄死了,慢慢来", "速度,一人一下,弄死", "你投降吧,免受皮肉之苦啊,投降给全尸", } if #self.enemies == 1 and player:getPhase() == sgs.Player_Start and self:getKingdomCount() == 2 and player:getPlayerNumWithSameKingdom("AI") >= 3 and self.enemies[1]:getPlayerNumWithSameKingdom("AI") == 1 and os.time() % 10 < 4 then local index = 1 + (os.time() % #chat) player:speak(chat[index]) end end sgs.ai_chat_func[sgs.CardUsed].qinshouzhang = function(self, player, data) if player:getState() ~= "robot" then return end local use = data:toCardUse() if use.card:isKindOf("Blade") and use.from and use.from:objectName() == player:objectName() then if player:screenName() == "SB-禽受装逼佬张" then player:speak("这把刀就是我爷爷传下来的,上斩逗比,下斩傻逼!") else for _, p in ipairs(sgs.robot) do if p:screenName() == "SB-禽受装逼佬张" then p:speak("敢抢我爷爷传下来的的刀,约吗?") end end end end end sgs.ai_chat_func[sgs.CardFinished].yaoseng = function(self, player, data) if player:getState() ~= "robot" then return end local use = data:toCardUse() if use.card:isKindOf("OffensiveHorse") and use.from:objectName() == player:objectName() then for _, p in sgs.qlist(self.room:getOtherPlayers(player)) do if self:isEnemy(player, p) and player:distanceTo(p) == 1 and player:distanceTo(p, 1) == 2 and math.random() < 0.2 then player:speak("妖僧" .. p:screenName() .. "你往哪里跑") return end end end end sgs.ai_chat_func[sgs.TargetConfirmed].gounannv = function(self, player, data) if player:getState() ~= "robot" then return end local use = data:toCardUse() if use.card:isKindOf("Peach") then local to = use.to:first() if to:objectName() ~= use.from:objectName() and use.from:isFemale() and to:isMale() and math.random() < 0.1 and to:getState() == "robot" and use.from:getState() == "robot" then use.from:speak("复活吧,我的勇士") to:speak("为你而战,我的女王") end end end sgs.ai_chat_func[sgs.CardFinished].analeptic = function(self, player, data) local use = data:toCardUse() if use.card:isKindOf("Analeptic") and use.card:getSkillName() ~= "zhendu" then local to = use.to:first() if to:getMark("drank") == 0 then return end local suit = { "spade", "heart", "club", "diamond" } suit = suit[math.random(1, #suit)] local chat = { "呵呵", "喜闻乐见", "前排围观,出售爆米花,矿泉水,花生,瓜子...", "不要砍我,我有" .. "<b><font color = 'yellow'>" .. sgs.Sanguosha:translate("jink") .. string.format("[<img src='image/system/log/%s.png' height = 12/>", suit) .. math.random(1, 10) .. "] </font></b>", "我菊花一紧" } for _, p in ipairs(sgs.robot) do if p:objectName() ~= to:objectName() and not p:isFriendWith(to) and math.random() < 0.2 then if not p:isWounded() then table.insert(chat, "我满血,不慌") end p:speak(chat[math.random(1, #chat)]) return end end end end sgs.ai_chat_func[sgs.EventPhaseStart]["ai_chat_scenario"] = function(self, player, data) if player:getPhase() ~= sgs.Player_Start then end if sgs.ai_chat_scenario then return end sgs.ai_chat_scenario = true for _, p in ipairs(sgs.robot) do if math.random() < 0.05 then if p:hasSkill("luanji") then sgs.ai_yuanshao_ArcheryAttack = {} end end end for _, p in ipairs(sgs.robot) do if player:objectName() ~= self.room:getCurrent():objectName() and math.random() < 0.1 then local chat = { "首先声明,谁砍我我砍谁", } player:speak(chat[math.random(1, #chat)]) return end end end sgs.ai_chat_func[sgs.TargetConfirmed].UnlimitedBladeWorks = function(self, player, data) if player:getState() ~= "robot" then return end local use = data:toCardUse() if use.card:isKindOf("ArcheryAttack") and player:hasSkill("luanji") and use.from and use.from:objectName() == player:objectName() and sgs.ai_yuanshao_ArcheryAttack then if #sgs.ai_yuanshao_ArcheryAttack == 0 then sgs.ai_yuanshao_ArcheryAttack = { "此身,为剑所成", "血如钢铁,心似琉璃", "跨越无数战场而不败", "未尝一度被理解", "亦未尝一度有所得", "剑之丘上,剑手孤单一人,沉醉于辉煌的胜利", "铁匠孑然一身,执著于悠远的锻造", "因此,此生没有任何意义", "那么,此生无需任何意义", "这身体,注定由剑而成" } end player:speak(sgs.ai_yuanshao_ArcheryAttack[1]) table.remove(sgs.ai_yuanshao_ArcheryAttack, 1) end end sgs.ai_chat_func[sgs.TargetConfirmed].imperial_order = function(self, player, data) if player:getState() ~= "robot" then return end local use = data:toCardUse() if use.card:isKindOf("ImperialOrder") and use.from and use.from:objectName() == player:objectName() then local chat = { "开门!查水表!", } if player:hasSkills("xiongyi|luanwu") then table.insert(chat, "都亮出来我好放大招") end if player:getKingdom() == "wei" then table.insert(chat, "我就看看是不是大魏") end player:speak(chat[math.random(1, #chat)]) end end function SmartAI:speak(cardtype, isFemale) if not sgs.GetConfig("AIChat", false) then return end if self.player:getState() ~= "robot" then return end if sgs.GetConfig("OriginAIDelay", 0) == 0 then return end if sgs.ai_chat[cardtype] then if type(sgs.ai_chat[cardtype]) == "function" then sgs.ai_chat[cardtype](self) elseif type(sgs.ai_chat[cardtype]) == "table" then if isFemale and sgs.ai_chat[cardtype .. "_female"] then cardtype = cardtype .. "_female" end local i = math.random(1, #sgs.ai_chat[cardtype]) self.player:speak(sgs.ai_chat[cardtype][i]) end end end sgs.ai_chat_func[sgs.CardFinished].duoshi = function(self, player, data) local use = data:toCardUse() if use.card:isKindOf("AwaitExhausted") and use.card:getSkillName() == "duoshi" and use.from:usedTimes("ViewAsSkill_duoshiCard") >= 2 then local chat = { "又刷牌了", "快点吧", "陆逊不要拖时间" } for _, p in ipairs(sgs.robot) do if p:objectName() ~= use.from:objectName() and math.random() < 0.8 then if p:hasSkill("xiaoji") then p:speak("继续继续") end p:speak(chat[math.random(1, #chat)]) return end end end end sgs.ai_chat_func[sgs.GeneralShown].show = function(self, player, data) if self.room:getMode() == "jiange_defense" then return end local name1 = sgs.Sanguosha:translate(self.player:getGeneralName()) local name2 = sgs.Sanguosha:translate(self.player:getGeneral2Name()) local kingdom = sgs.Sanguosha:translate(self.player:getKingdom()) local chat = { "好牛逼的武将呀", "干脆全都亮了吧" } local chat1 = { "亮一个", "没想到吧" } local notshown, shown= 0, 0 for _,p in sgs.qlist(self.room:getAlivePlayers()) do if not p:hasShownOneGeneral() then notshown = notshown + 1 end if p:hasShownOneGeneral() then shown = shown + 1 end end if shown == 1 then table.insert(chat,"首亮一时爽,全家火葬场") if sgs.GetConfig("RewardTheFirstShowingPlayer", true) then table.insert(chat1,"我来摸两张") end if not self.player:hasShownSkill("luanji") then table.insert(chat1,"你们懂不懂,渣将首亮防袁绍") else table.insert(chat,"大嘴你妹") end end if shown < 3 then table.insert(chat,"亮这么早,小心被打") table.insert(chat,"这么快就亮了?") end if notshown < 3 then table.insert(chat,"终于亮了") table.insert(chat,"竟然憋到现在") end if self.player:getRole() == "careerist" then table.insert(chat,"野了") table.insert(chat,"喜闻乐见野心家") table.insert(chat1,"竟然野了") end if not self.player:hasShownAllGenerals() then table.insert(chat,self.player:screenName() .."原来是"..kingdom) table.insert(chat,"看来这是大"..kingdom.."的节奏") elseif self.player:hasShownAllGenerals() then table.insert(chat, "我就说".. self.player:screenName() .."是"..name1..name2.."吧") table.insert(chat,"卧槽,"..name1..name2.."!") end for _, p in ipairs(sgs.robot) do if p:objectName() ~= self.player:objectName() and (math.random() < 0.06 or (self.player:getRole() == "careerist" and math.random() < 0.5)) then p:speak(chat[math.random(1, #chat)]) elseif p:objectName() == self.player:objectName() and (math.random() < 0.1 or shown == 1)then p:speak(chat1[math.random(1, #chat1)]) end end end sgs.ai_chat_func[sgs.DamageCaused].attackAnjiang = function(self, player, data) if self.room:getMode() == "jiange_defense" then return end local damage = data:toDamage() local chat = { "看看局势再说", "都不亮吗?", } local chat1= { "不亮就打到亮", "你敢说你不是郭嘉?" } local chat2= { "我说了我不卖", "别打我,打明的", } if damage and not damage.to:hasShownOneGeneral() then if damage.to:getMaxHp() == 3 then table.insert(chat, "3血不卖不是魏") end for _, p in ipairs(sgs.robot) do if not p:hasShownOneGeneral() then table.insert(chat, "你们不亮,我也不亮") table.insert(chat, "国战就是要猥琐") end if p:objectName() ~= damage.to:objectName() and math.random() < 0.05 then p:speak(chat[math.random(1, #chat)]) elseif p:objectName() == damage.from:objectName() and math.random() < 0.05 then p:speak(chat1[math.random(1, #chat1)]) elseif p:objectName() == damage.to:objectName() and math.random() < 0.1 then p:speak(chat2[math.random(1, #chat2)]) end end end end sgs.ai_chat_func[sgs.EventPhaseStart].luanwu = function(self, player, data) if player:getPhase() == sgs.Player_Play then local chat = { "乱一个,乱一个", "要乱了", "完了,没杀" } local chat1 = { "不要紧张", "准备好了吗?", "我凭什么听你的" } if self.player:hasShownSkill("luanwu") and self.player:getMark("@chaos") > 0 then for _, p in ipairs(sgs.robot) do if p:objectName() ~= player:objectName() and math.random() < 0.2 then p:speak(chat[math.random(1, #chat)]) elseif p:objectName() == player:objectName() and math.random() < 0.1 then p:speak(chat1[math.random(1, #chat1)]) end end end end end sgs.ai_chat_func[sgs.GeneralShown].show_jiange = function(self, player, data) if self.room:getMode() ~= "jiange_defense" then return end local kingdom = self.player:getKingdom() local chat1 = { "无知小儿,报上名来,饶你不死!", "剑阁乃险要之地,诸位将军须得谨慎行事。" } local chat2 = { "嗷~!", "呜~!", "发动机已启动,随时可以出发。。。" } if kingdom == "shu" then table.insert(chat1, "人在塔在!") table.insert(chat1, "汉室存亡,在此一战!") table.insert(chat2, "红色!") elseif kingdom == "wei" then table.insert(chat1, "众将官,剑阁去者!") table.insert(chat1, "此战若胜,大业必成!") table.insert(chat2, "蓝色!") end if string.find(self.player:getGeneral():objectName(), "baihu") then table.insert(chat2, "喵~!") end if string.find(self.player:getGeneral():objectName(), "jiangwei") then table.insert(chat1, "白水地狭路多,非征战之所,不如且退,去救剑阁。若剑阁一失,是绝路也。") table.insert(chat1, "今四面受敌,粮道不同,不如退守剑阁,再作良图。") elseif string.find(self.player:getGeneral():objectName(), "dengai") then table.insert(chat1, "剑阁之守必还赴涪,则会方轨而进;剑阁之军不还,则应涪之兵寡矣。") table.insert(chat1, "以愚意度之,可引一军从阴平小路出汉中德阳亭,用奇兵径取成都,姜维必撤兵来救,将军乘虚就取剑阁,可获全功。") end for _, p in ipairs(sgs.robot) do if p:objectName() == self.player:objectName() and (string.find(self.player:getGeneral():objectName(), "jg_") or math.random() < 0.1) then if string.find(self.player:getGeneral():objectName(), "machine") then p:speak(chat2[math.random(1, #chat2)]) else p:speak(chat1[math.random(1, #chat1)]) end end end end sgs.ai_chat.yiji = { "再用力一点", "要死了啊!" } sgs.ai_chat.Snatch_female = { "啧啧啧,来帮你解决点手牌吧", "叫你欺负人!" , "手牌什么的最讨厌了" } sgs.ai_chat.Snatch = { "yoooo少年,不来一发么", "果然还是看你不爽", "我看你霸气外露,不可不防啊" } sgs.ai_chat.Dismantlement_female = sgs.ai_chat.Snatch_female sgs.ai_chat.Dismantlement = sgs.ai_chat.Snatch sgs.ai_chat.respond_hostile = { "擦,小心菊花不保", "内牛满面了", "哎哟我去" } sgs.ai_chat.friendly = { "。。。" } sgs.ai_chat.respond_friendly = { "谢了。。。" } sgs.ai_chat.Duel_female = { "哼哼哼,怕了吧" } sgs.ai_chat.Duel = { "来吧!像男人一样决斗吧!", "我只用一张牌就能搞死你" } sgs.ai_chat.ExNihilo = { "哎哟运气好", "哈哈哈哈哈" } sgs.ai_chat.Collateral_female = { "别以为这样就算赢了!" } sgs.ai_chat.Collateral = { "你妹啊,我的刀!" } sgs.ai_chat.jijiang_female = { "别指望下次我会帮你哦" } sgs.ai_chat.jijiang = { "主公,我来啦" } --huanggai sgs.ai_chat.KurouCard = { "有桃么!有桃么?", "教练,我想要摸桃", "桃桃桃我的桃呢", "求桃求连弩各种求" } --indulgence sgs.ai_chat.indulgence = { "乐,乐你妹啊乐", "擦,乐我", "诶诶诶被乐了!" } --leiji sgs.ai_chat.leiji_jink = { "我有闪我会到处乱说么?", "你觉得我有木有闪啊", "哈我有闪" } --quhu sgs.ai_chat.quhu = { "出大的!", "来来来拼点了", "哟,拼点吧" } --salvageassault sgs.ai_chat.daxiang = { "好多大象啊!", "擦,孟获你的宠物又调皮了", "内牛满面啊敢不敢少来点AOE" } --xiahoudun sgs.ai_chat.ganglie_death = { "菊花残,满地伤。。。" } sgs.ai_chat.guojia_weak = { "擦,再卖血会卖死的", "不敢再卖了诶诶诶诶" } sgs.ai_chat.yuanshao_fire = { "谁去打119啊", "别别别烧了别烧了。。。", "又烧啊,饶了我吧。。。" } --xuchu sgs.ai_chat.luoyi = { "不脱光衣服干不过你" } sgs.ai_chat.usepeach = { "不好,这桃里有屎" } sgs.ai_chat.LureTiger = function(self) if math.random() < 0.05 then local chat = { "爆裂吧!现实!粉碎吧!精神!放逐这个世界!", } self.player:speak(chat[math.random(1, #chat)]) end end sgs.ai_chat.BurningCamps = function(self) local x = math.random() if x < 0.033 then self.player:speak("让火焰净化一切") elseif x < 0.067 then local t = sgs.GetConfig("OriginAIDelay", 0) self.player:speak("火元素之王啊") self.room:getThread():delay(t) self.player:speak("藉由您所有的力量") self.room:getThread():delay(t) self.player:speak("赐与我强大的烈焰之力吧!") self.room:getThread():delay(t) self.player:speak("火烧连营~") elseif x < 0.1 then local t = sgs.GetConfig("OriginAIDelay", 0) self.player:speak("狂暴的火之精灵哦") self.room:getThread():delay(t) self.player:speak("将您的力量暂时给予我") self.room:getThread():delay(t) self.player:speak("您的契约者在此呼唤") self.room:getThread():delay(t) self.player:speak("爆裂吾眼前所有之物") end end
gpl-3.0
NerdWalletOSS/Q
RUNTIME/test/test_gen3.lua
1
1188
local plfile = require 'pl.file' local plpath = require 'pl.path' local Vector = require 'libvec' local Scalar = require 'libsclr' local cmem = require 'libcmem' local lVector = require 'Q/RUNTIME/lua/lVector' require 'Q/UTILS/lua/strict' local qconsts = require 'Q/UTILS/lua/q_consts' local qc = require 'Q/UTILS/lua/q_core' local ffi = require 'Q/UTILS/lua/q_ffi' local gen_bin = require 'Q/RUNTIME/test/generate_bin' local expander_gen3 = require 'Q/RUNTIME/test/expander_gen3' local tests = {} --====== Testing nascent vector with generator (gen3) tests.t1 = function() -- generating required .bin file qc.generate_bin(10, "I4","_in1_I4.bin", "linear") print("Creating nascent vector with generator gen3") local v1 = lVector( { qtype = "I4", file_name = "_in1_I4.bin"}) local gen3 = expander_gen3(v1, v1) local x = lVector( { qtype = "I4", gen = gen3, has_nulls = false}) local chunk_idx = 0 repeat local len, addr, nn_addr = x:chunk(chunk_idx) print("len/chunk_idx = ", len, chunk_idx) chunk_idx = chunk_idx + 1 until (len == 0) assert(x:num_elements() == 5600) print("Successfully completed test t1") end return tests
mit
Oliveryo/Interface
AddOns/BigWigs/Plugins/RaidOfficer.lua
1
2836
--[[ by LYQ(Virose / MOUZU) https://github.com/MOUZU/BigWigs This small plugin simply allows to move players in the raidgroup from one subgroup to another, if the player using this version is a RaidAssistant. Previously this was possible in blizzards API but not implemented. --]] ---------------------------------- -- Module Declaration -- ---------------------------------- BigWigsRaidOfficer = BigWigs:NewModule("RaidOfficer") ------------------------------ -- Initialization -- ------------------------------ function BigWigsRaidOfficer:OnEnable() self:ScheduleEvent(self.SetupFrames,2) end ------------------------------ -- Event Handlers -- ------------------------------ function BigWigs_RaidGroupButton_OnDragStart() if ( not IsRaidLeader() and not IsRaidOfficer() ) then return; end local cursorX, cursorY = GetCursorPosition(); this:ClearAllPoints(); this:SetPoint("CENTER", nil, "BOTTOMLEFT", cursorX*GetScreenWidthScale(), cursorY*GetScreenHeightScale()); this:StartMoving(); MOVING_RAID_MEMBER = this; SetRaidRosterSelection(this.id); end function BigWigs_RaidGroupButton_OnDragStop(raidButton) if ( not IsRaidLeader() and not IsRaidOfficer() ) then return; end if ( not raidButton ) then raidButton = this; end raidButton:StopMovingOrSizing(); MOVING_RAID_MEMBER = nil; if ( TARGET_RAID_SLOT and TARGET_RAID_SLOT:GetParent():GetID() ~= raidButton.subgroup ) then if (TARGET_RAID_SLOT.button) then local button = getglobal(TARGET_RAID_SLOT.button); --button:SetPoint("TOPLEFT", this, "TOPLEFT", 0, 0); SwapRaidSubgroup(raidButton:GetID(), button:GetID()); else local slot = TARGET_RAID_SLOT:GetParent():GetName().."Slot"..TARGET_RAID_SLOT:GetParent().nextIndex; raidButton:ClearAllPoints(); raidButton:SetPoint("TOPLEFT", slot, "TOPLEFT", 0, 0); TARGET_RAID_SLOT:UnlockHighlight(); SetRaidSubgroup(raidButton:GetID(), TARGET_RAID_SLOT:GetParent():GetID()); end else if ( TARGET_RAID_SLOT ) then TARGET_RAID_SLOT:UnlockHighlight(); end raidButton:ClearAllPoints(); raidButton:SetPoint("TOPLEFT", raidButton.slot, "TOPLEFT", 0, 0); end end function BigWigsRaidOfficer:SetupFrames() -- I know someone else did a similar AddOn, my BigWigs might get in conflict with the other one -- but I don't know what the name of the other AddOn is. TODO: Change 'unknownyet' if not IsAddOnLoaded("unknownyet") then -- backup the old ones just in case ORIGINAL_RaidGroupButton_OnDragStart = RaidGroupButton_OnDragStart ORIGINAL_RaidGroupButton_OnDragStop = RaidGroupButton_OnDragStop -- overwrite them RaidGroupButton_OnDragStart = BigWigs_RaidGroupButton_OnDragStart RaidGroupButton_OnDragStop = BigWigs_RaidGroupButton_OnDragStop end end
gpl-3.0
Oliveryo/Interface
AddOns/BigWigs/Libs/Babble-Zone-2.2/Babble-Zone-2.2.lua
3
34659
--[[ Name: Babble-Zone-2.2 Revision: $Rev: 17779 $ Author(s): ckknight (ckknight@gmail.com) Website: http://ckknight.wowinterface.com/ Documentation: http://wiki.wowace.com/index.php/Babble-Zone-2.2 SVN: http://svn.wowace.com/root/trunk/Babble-2.2/Babble-Zone-2.2 Description: A library to provide localizations for zones. Dependencies: AceLibrary, AceLocale-2.2 ]] local MAJOR_VERSION = "Babble-Zone-2.2" local MINOR_VERSION = tonumber(string.sub("$Revision: 17779 $", 12, -3)) if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end if not AceLibrary:HasInstance("AceLocale-2.2") then error(MAJOR_VERSION .. " requires AceLocale-2.2") end local _, x = AceLibrary("AceLocale-2.2"):GetLibraryVersion() MINOR_VERSION = MINOR_VERSION * 100000 + x if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end local BabbleZone = AceLibrary("AceLocale-2.2"):new(MAJOR_VERSION) -- uncomment below for debug information -- BabbleZone:EnableDebugging() BabbleZone:RegisterTranslations("enUS", function() return { ["Ahn'Qiraj"] = true, ["Alterac Mountains"] = true, ["Alterac Valley"] = true, ["Arathi Basin"] = true, ["Arathi Highlands"] = true, ["Ashenvale"] = true, ["Auberdine"] = true, ["Azshara"] = true, ["Badlands"] = true, ["The Barrens"] = true, ["Blackfathom Deeps"] = true, ["Blackrock Depths"] = true, ["Blackrock Mountain"] = true, ["Blackrock Spire"] = true, ["Blackwing Lair"] = true, ["Blasted Lands"] = true, ["Booty Bay"] = true, ["Burning Steppes"] = true, ["Darkshore"] = true, ["Darnassus"] = true, ["The Deadmines"] = true, ["Deadwind Pass"] = true, ["Deeprun Tram"] = true, ["Desolace"] = true, ["Dire Maul"] = true, ["Dire Maul (East)"] = true, ["Dire Maul (West)"] = true, ["Dire Maul (North)"] = true, ["Dun Morogh"] = true, ["Durotar"] = true, ["Duskwood"] = true, ["Dustwallow Marsh"] = true, ["Eastern Plaguelands"] = true, ["Elwynn Forest"] = true, ["Everlook"] = true, ["Felwood"] = true, ["Feralas"] = true, ["The Forbidding Sea"] = true, ["Gadgetzan"] = true, ["Gates of Ahn'Qiraj"] = true, ["Gnomeregan"] = true, ["The Great Sea"] = true, ["Grom'gol Base Camp"] = true, ["Hall of Legends"] = true, ["Hillsbrad Foothills"] = true, ["The Hinterlands"] = true, ["Hyjal"] = true, ["Ironforge"] = true, ["Loch Modan"] = true, ["Lower Blackrock Spire"] = true, ["Maraudon"] = true, ["Menethil Harbor"] = true, ["Molten Core"] = true, ["Moonglade"] = true, ["Mulgore"] = true, ["Naxxramas"] = true, ["Onyxia's Lair"] = true, ["Orgrimmar"] = true, ["Ratchet"] = true, ["Ragefire Chasm"] = true, ["Razorfen Downs"] = true, ["Razorfen Kraul"] = true, ["Redridge Mountains"] = true, ["Ruins of Ahn'Qiraj"] = true, ["Scarlet Monastery"] = true, ["Scholomance"] = true, ["Searing Gorge"] = true, ["Shadowfang Keep"] = true, ["Silithus"] = true, ["Silverpine Forest"] = true, ["The Stockade"] = true, ["Stonetalon Mountains"] = true, ["Stormwind City"] = true, ["Stranglethorn Vale"] = true, ["Stratholme"] = true, ["Swamp of Sorrows"] = true, ["Tanaris"] = true, ["Teldrassil"] = true, ["Temple of Ahn'Qiraj"] = true, ["The Temple of Atal'Hakkar"] = true, ["Theramore Isle"] = true, ["Thousand Needles"] = true, ["Thunder Bluff"] = true, ["Tirisfal Glades"] = true, ["Uldaman"] = true, ["Un'Goro Crater"] = true, ["Undercity"] = true, ["Upper Blackrock Spire"] = true, ["Wailing Caverns"] = true, ["Warsong Gulch"] = true, ["Western Plaguelands"] = true, ["Westfall"] = true, ["Wetlands"] = true, ["Winterspring"] = true, ["Zul'Farrak"] = true, ["Zul'Gurub"] = true, -- Burning Crusade -- Subzones used for displaying instances. ["Plaguewood"] = true, ["Hellfire Citadel"] = true, ["Auchindoun"] = true, ["The Bone Wastes"] = true, -- Substitute for Auchindoun, since this is what shows on the minimap. ["Coilfang Reservoir"] = true, -- Not used yet. ["Azuremyst Isle"] = true, ["Bloodmyst Isle"] = true, ["Eversong Woods"] = true, ["Ghostlands"] = true, ["The Exodar"] = true, ["Silvermoon City"] = true, ["Shadowmoon Valley"] = true, ["Black Temple"] = true, ["Terokkar Forest"] = true, ["Auchenai Crypts"] = true, ["Mana-Tombs"] = true, ["Shadow Labyrinth"] = true, ["Sethekk Halls"] = true, ["Hellfire Peninsula"] = true, ["The Dark Portal"] = true, ["Hellfire Ramparts"] = true, ["The Blood Furnace"] = true, ["The Shattered Halls"] = true, ["Magtheridon's Lair"] = true, ["Nagrand"] = true, ["Zangarmarsh"] = true, ["The Slave Pens"] = true, ["The Underbog"] = true, ["The Steamvault"] = true, ["Serpentshrine Cavern"] = true, ["Blade's Edge Mountains"] = true, ["Gruul's Lair"] = true, ["Netherstorm"] = true, ["Tempest Keep"] = true, ["The Mechanar"] = true, ["The Botanica"] = true, ["The Arcatraz"] = true, ["Eye of the Storm"] = true, ["Shattrath City"] = true, ["Karazhan"] = true, ["Caverns of Time"] = true, ["Zul'Aman"] = true, } end) local expansion = loadstring("return function(...) return ... end") and true or false BabbleZone:RegisterTranslations("deDE", function() return { ["Ahn'Qiraj"] = "Ahn'Qiraj", ["Alterac Mountains"] = "Alteracgebirge", ["Alterac Valley"] = "Alteractal", ["Arathi Basin"] = "Arathibecken", ["Arathi Highlands"] = "Arathihochland", ["Ashenvale"] = "Ashenvale", ["Auberdine"] = "Auberdine", ["Azshara"] = "Azshara", ["Badlands"] = "\195\150dland", ["The Barrens"] = "Brachland", ["Blackfathom Deeps"] = "Blackfathom-Tiefe", ["Blackrock Depths"] = "Blackrocktiefen", ["Blackrock Mountain"] = "Der Blackrock", ["Blackrock Spire"] = "Blackrockspitze", ["Blackwing Lair"] = "Pechschwingenhort", ["Blasted Lands"] = "Verw\195\188stete Lande", ["Booty Bay"] = "Booty Bay", ["Burning Steppes"] = "Brennende Steppe", ["Darkshore"] = "Dunkelk\195\188ste", ["Darnassus"] = "Darnassus", ["The Deadmines"] = "Die Todesminen", ["Deadwind Pass"] = "Gebirgspass der Totenwinde", ["Deeprun Tram"] = "Die Tiefenbahn", ["Desolace"] = "Desolace", ["Dire Maul"] = "D\195\188sterbruch", ["Dire Maul (North)"] = "D\195\188sterbruch (Nord)", ["Dire Maul (East)"] = "D\195\188sterbruch (Ost)", ["Dire Maul (West)"] = "D\195\188sterbruch (West)", ["Dun Morogh"] = "Dun Morogh", ["Durotar"] = "Durotar", ["Duskwood"] = "D\195\164mmerwald", ["Dustwallow Marsh"] = "Marschen von Dustwallow", ["Eastern Plaguelands"] = "\195\150stliche Pestl\195\164nder", ["Elwynn Forest"] = "Wald von Elwynn", ["Everlook"] = "Everlook", ["Felwood"] = "Teufelswald", ["Feralas"] = "Feralas", ["The Forbidding Sea"] = "Das verbotene Meer", ["Gadgetzan"] = "Gadgetzan", ["Gates of Ahn'Qiraj"] = "Tore von Ahn'Qiraj", ["Gnomeregan"] = "Gnomeregan", ["Grom'gol Base Camp"] = "Grom'gol Basis Lager", ["The Great Sea"] = "Das grosse Meer", ["Hall of Legends"] = "Halle der Legenden", ["Hillsbrad Foothills"] = "Vorgebirge von Hillsbrad", ["The Hinterlands"] = "Hinterland", ["Hyjal"] = "Hyjal", ["Ironforge"] = expansion and "Eisenschmiede" or "Ironforge", ["Loch Modan"] = "Loch Modan", ["Lower Blackrock Spire"] = "Untere Blockrockspitze", ["Maraudon"] = "Maraudon", ["Menethil Harbor"] = "Menethil Hafen", ["Molten Core"] = "Geschmolzener Kern", ["Moonglade"] = "Moonglade", ["Mulgore"] = "Mulgore", ["Naxxramas"] = "Naxxramas", ["Onyxia's Lair"] = "Onyxias Hort", ["Orgrimmar"] = "Orgrimmar", ["Ratchet"] = "Ratchet", ["Ragefire Chasm"] = "Ragefireabgrund", ["Razorfen Downs"] = "Die H\195\188gel von Razorfen", ["Razorfen Kraul"] = "Der Kral von Razorfen", ["Redridge Mountains"] = "Rotkammgebirge", ["Ruins of Ahn'Qiraj"] = "Ruinen von Ahn'Qiraj", ["Scarlet Monastery"] = "Das Scharlachrote Kloster", ["Scholomance"] = "Scholomance", ["Searing Gorge"] = "Sengende Schlucht", ["Shadowfang Keep"] = "Burg Shadowfang", ["Silithus"] = "Silithus", ["Silverpine Forest"] = "Silberwald", ["The Stockade"] = "Das Verlies", ["Stonetalon Mountains"] = "Steinkrallengebirge", ["Stormwind City"] = expansion and "Sturmwind" or "Stormwind", ["Stranglethorn Vale"] = "Schlingendorntal", ["Stratholme"] = "Stratholme", ["Swamp of Sorrows"] = "S\195\188mpfe des Elends", ["Tanaris"] = "Tanaris", ["Teldrassil"] = "Teldrassil", ["Temple of Ahn'Qiraj"] = "Tempel von Ahn'Qiraj", ["The Temple of Atal'Hakkar"] = "Der Tempel von Atal'Hakkar", ["Theramore Isle"] = "Insel Theramore", ["Thousand Needles"] = "Tausend Nadeln", ["Thunder Bluff"] = "Thunder Bluff", ["Tirisfal Glades"] = "Tirisfal", ["Uldaman"] = "Uldaman", ["Un'Goro Crater"] = "Un'Goro-Krater", ["Undercity"] = "Undercity", ["Upper Blackrock Spire"] = "Obere Blackrockspitze", ["Wailing Caverns"] = "Die H\195\182hlen des Wehklagens", ["Warsong Gulch"] = "Warsongschlucht", ["Western Plaguelands"] = "Westliche Pestl\195\164nder", ["Westfall"] = "Westfall", ["Wetlands"] = "Sumpfland", ["Winterspring"] = "Winterspring", ["Zul'Farrak"] = "Zul'Farrak", ["Zul'Gurub"] = "Zul'Gurub", -- Burning Crusade -- Subzones used for displaying instances. ["Plaguewood"] = "Seuchenwald", ["Hellfire Citadel"] = "H\195\182llenfeuerzitadelle", ["Auchindoun"] = "Auchindoun", ["The Bone Wastes"] = "Die Knochen-Vergeudungen", -- Substitute for Auchindoun, since this is what shows on the minimap. ["Coilfang Reservoir"] = "Spulenrei\195\159zahn Reservat", ["Azuremyst Isle"] = "Azurmythosinsel", ["Bloodmyst Isle"] = "Blutmythosinsel", ["Eversong Woods"] = "Immersangwald", ["Ghostlands"] = "Geisterlande", ["The Exodar"] = "Die Exodar", ["Silvermoon City"] = "Silbermond", ["Shadowmoon Valley"] = "Schattenmondtal", ["Black Temple"] = "Schwarzer Tempel", ["Terokkar Forest"] = "W\195\164lder von Terokkar", ["Auchenai Crypts"] = "Auchenai Krypten", ["Mana-Tombs"] = "Mana-Gr\195\164ber", ["Shadow Labyrinth"] = "Schattenlabyrinth", ["Sethekk Halls"] = "Sethekk Hallen", ["Hellfire Peninsula"] = "H\195\182llenfeuerhalbinsel", ["The Dark Portal"] = "Das Dunkle Portal", ["Hellfire Ramparts"] = "H\195\182llenfeuer Ramteile", ["The Blood Furnace"] = "Der Blut-Ofen", ["The Shattered Halls"] = "Die Zerbrochenen Hallen", ["Magtheridon's Lair"] = "Magtheridon's Hort", ["Nagrand"] = "Nagrand", ["Zangarmarsh"] = "Zangarmarschen", ["The Slave Pens"] = "Die Sklavenfedern", ["The Underbog"] = "Der Untersumpf", ["The Steamvault"] = "Die Dampfw\195\182lbung", ["Serpentshrine Cavern"] = "Schlangenschrein H\195\182hle", ["Blade's Edge Mountains"] = "Schergrat", ["Gruul's Lair"] = "Gruul's Hort", ["Netherstorm"] = "Nethersturm", ["Tempest Keep"] = "Tempest Unterschlupf", ["The Mechanar"] = "Das Mechanar", ["The Botanica"] = "Das Botanica", ["The Arcatraz"] = "Das Arcatraz", ["Eye of the Storm"] = "Auge des Sturms", ["Shattrath City"] = "Shattrath", ["Karazhan"] = "Karazhan", ["Caverns of Time"] = "Die H\195\182hlen der Zeit", ["Zul'Aman"] = "Zul'Aman", } end) BabbleZone:RegisterTranslations("frFR", function() return { ["Ahn'Qiraj"] = "Ahn'Qiraj", ["Alterac Mountains"] = "Montagnes d'Alterac", ["Alterac Valley"] = "Vall\195\169e d'Alterac", ["Arathi Basin"] = "Bassin d'Arathi", ["Arathi Highlands"] = "Hautes-terres d'Arathi", ["Ashenvale"] = "Ashenvale", ["Auberdine"] = "Auberdine", ["Azshara"] = "Azshara", ["Badlands"] = "Terres ingrates (Badlands)", ["The Barrens"] = "Les Tarides (the Barrens)", ["Blackfathom Deeps"] = "Profondeurs de Brassenoire", ["Blackrock Depths"] = "Profondeurs de Blackrock", ["Blackrock Mountain"] = "Mont Blackrock", ["Blackrock Spire"] = "Pic Blackrock", ["Blackwing Lair"] = "Repaire de l'Aile noire", ["Blasted Lands"] = "Terres foudroy\195\169es (Blasted Lands)", ["Booty Bay"] = "Baie-du-Butin", ["Burning Steppes"] = "Steppes ardentes", ["Darkshore"] = "Sombrivage (Darkshore)", ["Darnassus"] = "Darnassus", ["The Deadmines"] = "Les mortemines", ["Deadwind Pass"] = "D\195\169fil\195\169 de Deuillevent (Deadwind Pass)", ["Deeprun Tram"] = "Tram des profondeurs", ["Desolace"] = "D\195\169solace", ["Dire Maul"] = "Hache-tripes", ["Dire Maul (East)"] = "Hache-tripes (Est)", ["Dire Maul (West)"] = "Hache-tripes (Ouest)", ["Dire Maul (North)"] = "Hache-tripes (Nord)", ["Dun Morogh"] = "Dun Morogh", ["Durotar"] = "Durotar", ["Duskwood"] = "Bois de la P\195\169nombre (Duskwood)", ["Dustwallow Marsh"] = "Mar\195\169cage d'\195\130prefange (Dustwallow Marsh)", ["Eastern Plaguelands"] = "Maleterres de l'est (Eastern Plaguelands)", ["Elwynn Forest"] = "For\195\170t d'Elwynn", ["Everlook"] = "Long-guet", ["Felwood"] = "Gangrebois (Felwood)", ["Feralas"] = "Feralas", ["The Forbidding Sea"] = "La Mer interdite", ["Gadgetzan"] = "Gadgetzan", ["Gates of Ahn'Qiraj"] = "Portes d'Ahn'Qiraj", ["Gnomeregan"] = "Gnomeregan", ["Grom'gol Base Camp"] = "Campement Grom'gol", ["The Great Sea"] = "La Grande mer", ["Hall of Legends"] = "Hall des L\195\169gendes", ["Hillsbrad Foothills"] = "Contreforts d'Hillsbrad", ["The Hinterlands"] = "Les Hinterlands", ["Hyjal"] = "Hyjal", ["Ironforge"] = "Ironforge", ["Loch Modan"] = "Loch Modan", ["Lower Blackrock Spire"] = "Pic de Blackrock inf\195\169rieur", ["Maraudon"] = "Maraudon", ["Menethil Harbor"] = "Port de Menethil", ["Molten Core"] = "C\197\147ur du Magma", ["Moonglade"] = "Reflet-de-Lune (Moonglade)", ["Mulgore"] = "Mulgore", ["Onyxia's Lair"] = "Repaire d'Onyxia", ["Naxxramas"] = "Naxxramas", ["Orgrimmar"] = "Orgrimmar", ["Ratchet"] = "Ratchet", ["Ragefire Chasm"] = "Gouffre de Ragefeu", ["Razorfen Downs"] = "Souilles de Tranchebauge", ["Razorfen Kraul"] = "Kraal de Tranchebauge", ["Redridge Mountains"] = "Les Carmines (Redridge Mts)", ["Ruins of Ahn'Qiraj"] = "Ruines d'Ahn'Qiraj", ["Scarlet Monastery"] = "Monast\195\168re \195\169carlate", ["Scholomance"] = "Scholomance", ["Searing Gorge"] = "Gorge des Vents br\195\187lants (Searing Gorge)", ["Shadowfang Keep"] = "Donjon d'Ombrecroc", ["Silithus"] = "Silithus", ["Silverpine Forest"] = "For\195\170t des Pins argent\195\169s (Silverpine Forest)", ["The Stockade"] = "La Prison", ["Stonetalon Mountains"] = "Les Serres-Rocheuses (Stonetalon Mts)", ["Stormwind City"] = "Cit\195\169 de Stormwind", ["Stranglethorn Vale"] = "Vall\195\169e de Strangleronce (Stranglethorn Vale)", ["Stratholme"] = "Stratholme", ["Swamp of Sorrows"] = "Marais des Chagrins (Swamp of Sorrows)", ["Tanaris"] = "Tanaris", ["Teldrassil"] = "Teldrassil", ["Temple of Ahn'Qiraj"] = "Le temple d'Ahn'Qiraj", ["The Temple of Atal'Hakkar"] = "Le Temple d'Atal'Hakkar", ["Theramore Isle"] = "Ile de Theramore", ["Thousand Needles"] = "Mille pointes (Thousand Needles)", ["Thunder Bluff"] = "Thunder Bluff", ["Tirisfal Glades"] = "Clairi\195\168res de Tirisfal", ["Uldaman"] = "Uldaman", ["Un'Goro Crater"] = "Crat\195\168re d'Un'Goro", ["Undercity"] = "Undercity", ["Upper Blackrock Spire"] = "Pic de Blackrock sup\195\169rieur", ["Wailing Caverns"] = "Cavernes des lamentations", ["Warsong Gulch"] = "Goulet des Warsong", ["Western Plaguelands"] = "Maleterres de l'ouest (Western Plaguelands)", ["Westfall"] = "Marche de l'Ouest (Westfall)", ["Wetlands"] = "Les Paluns (Wetlands)", ["Winterspring"] = "Berceau-de-l'Hiver (Winterspring)", ["Zul'Farrak"] = "Zul'Farrak", ["Zul'Gurub"] = "Zul'Gurub", -- Burning Crusade -- Subzones used for displaying instances. --["Plaguewood"] = true, ["Hellfire Citadel"] = "Citadelle des Flammes infernales", ["Auchindoun"] = "Auchindoun", --["The Bone Wastes"] = true, -- Substitute for Auchindoun, since this is what shows on the minimap. ["Coilfang Reservoir"] = "R\195\169servoir de Glissecroc", -- Not used yet. ["Azuremyst Isle"] = "Ile de Brume-azure", ["Bloodmyst Isle"] = "Ile de Brume-sang", ["Eversong Woods"] = "Bois des Chants \195\169ternels", ["Ghostlands"] = "Les Terres fant\195\180mes", ["The Exodar"] = "L'Exodar", ["Silvermoon City"] = "Lune-d'argent", ["Shadowmoon Valley"] = "Vall\195\169e d'Ombrelune", ["Black Temple"] = "Temple noir", ["Terokkar Forest"] = "For\195\170t de Terokkar", ["Auchenai Crypts"] = "Cryptes des Auchena\195\175", ["Mana-Tombs"] = "Tombes-mana", ["Shadow Labyrinth"] = "Labyrinthe des Ombres", ["Sethekk Halls"] = "Les salles de Sethekk", ["Hellfire Peninsula"] = "P\195\169ninsule des Flammes infernales", ["The Dark Portal"] = "La Porte des t\195\169n\195\168bres", ["Hellfire Ramparts"] = "Remparts des Flammes infernales", ["The Blood Furnace"] = "La Fournaise du sang", ["The Shattered Halls"] = "Les Salles bris\195\169es", ["Magtheridon's Lair"] = "Le repaire de Magtheridon", ["Nagrand"] = "Nagrand", ["Zangarmarsh"] = "Mar\195\169cage de Zangar", ["The Slave Pens"] = "Les enclos aux esclaves", ["The Underbog"] = "La Basse-tourbi\195\168re", ["The Steamvault"] = "Le Caveau de la vapeur", ["Serpentshrine Cavern"] = "Sanctuaire du Serpent", ["Blade's Edge Mountains"] = "Les Tranchantes", ["Gruul's Lair"] = "Le repaire de Gruul", ["Netherstorm"] = "Raz-de-N\195\169ant", ["Tempest Keep"] = "Donjon de la temp\195\170te", ["The Mechanar"] = "Le M\195\169chanar", ["The Botanica"] = "La Botanica", ["The Arcatraz"] = "L'Arcatraz", ["Eye of the Storm"] = "L'\197\146il du cyclone", ["Shattrath City"] = "Shattrath", ["Karazhan"] = "Karazhan", ["Caverns of Time"] = "Grottes du temps", ["Zul'Aman"] = "Zul'Aman", } end) BabbleZone:RegisterTranslations("zhCN", function() return { ["Ahn'Qiraj"] = "安其拉", ["Alterac Mountains"] = "奥特兰克山脉", ["Alterac Valley"] = "奥特兰克山谷", ["Arathi Basin"] = "阿拉希盆地", ["Arathi Highlands"] = "阿拉希高地", ["Ashenvale"] = "灰谷", ["Auberdine"] = "奥伯丁", ["Azshara"] = "艾萨拉", ["Badlands"] = "荒芜之地", ["The Barrens"] = "贫瘠之地", ["Blackfathom Deeps"] = "黑暗深渊", ["Blackrock Depths"] = "黑石深渊", ["Blackrock Mountain"] = "黑石山", ["Blackrock Spire"] = "黑石塔", ["Blackwing Lair"] = "黑翼之巢", ["Blasted Lands"] = "诅咒之地", ["Booty Bay"] = "藏宝海湾", ["Burning Steppes"] = "燃烧平原", ["Darkshore"] = "黑海岸", ["Darnassus"] = "达纳苏斯", ["The Deadmines"] = "死亡矿井", ["Deadwind Pass"] = "逆风小径", ["Deeprun Tram"] = "矿道地铁", ["Desolace"] = "凄凉之地", ["Dire Maul"] = "厄运之槌", ["Dire Maul (East)"] = "厄运之槌(东)", ["Dire Maul (West)"] = "厄运之槌(西)", ["Dire Maul (North)"] = "厄运之槌(北)", ["Dun Morogh"] = "丹莫罗", ["Durotar"] = "杜隆塔尔", ["Duskwood"] = "暮色森林", ["Dustwallow Marsh"] = "尘泥沼泽", ["Eastern Plaguelands"] = "东瘟疫之地", ["Elwynn Forest"] = "艾尔文森林", ["Everlook"] = "永望镇", ["Felwood"] = "费伍德森林", ["Feralas"] = "菲拉斯", ["The Forbidding Sea"] = "禁忌之海", ["Gadgetzan"] = "加基森", ["Gates of Ahn'Qiraj"] = "安其拉之门", ["Gnomeregan"] = "诺莫瑞根", ["The Great Sea"] = "无尽之海", ["Grom'gol Base Camp"] = "格罗姆高营地", ["Hall of Legends"] = "传说大厅", ["Hillsbrad Foothills"] = "希尔斯布莱德丘陵", ["The Hinterlands"] = "辛特兰", ["Hyjal"] = "海加尔", ["Ironforge"] = "铁炉堡", ["Loch Modan"] = "洛克莫丹", -- ["Lower Blackrock Spire"] = true, ["Maraudon"] = "玛拉顿", ["Menethil Harbor"] = "米奈希尔港", ["Molten Core"] = "熔火之心", ["Moonglade"] = "月光林地", ["Mulgore"] = "莫高雷", ["Naxxramas"] = "纳克萨玛斯", ["Onyxia's Lair"] = "奥妮克希亚的巢穴", ["Orgrimmar"] = "奥格瑞玛", ["Ratchet"] = "棘齿城", ["Ragefire Chasm"] = "怒焰裂谷", ["Razorfen Downs"] = "剃刀高地", ["Razorfen Kraul"] = "剃刀沼泽", ["Redridge Mountains"] = "赤脊山", ["Ruins of Ahn'Qiraj"] = "安其拉废墟", ["Scarlet Monastery"] = "血色修道院", ["Scholomance"] = "通灵学院", ["Searing Gorge"] = "灼热峡谷", ["Shadowfang Keep"] = "影牙城堡", ["Silithus"] = "希利苏斯", ["Silverpine Forest"] = "银松森林", ["The Stockade"] = "暴风城监狱", ["Stonetalon Mountains"] = "石爪山脉", ["Stormwind City"] = "暴风城", ["Stranglethorn Vale"] = "荆棘谷", ["Stratholme"] = "斯坦索姆", ["Swamp of Sorrows"] = "悲伤沼泽", ["Tanaris"] = "塔纳利斯", ["Teldrassil"] = "泰达希尔", ["Temple of Ahn'Qiraj"] = "安其拉神殿", ["The Temple of Atal'Hakkar"] = "阿塔哈卡神庙", ["Theramore Isle"] = "塞拉摩岛", ["Thousand Needles"] = "千针石林", ["Thunder Bluff"] = "雷霆崖", ["Tirisfal Glades"] = "提瑞斯法林地", ["Uldaman"] = "奥达曼", ["Un'Goro Crater"] = "安戈洛环形山", ["Undercity"] = "幽暗城", -- ["Upper Blackrock Spire"] = true, ["Wailing Caverns"] = "哀嚎洞穴", ["Warsong Gulch"] = "战歌峡谷", ["Western Plaguelands"] = "西瘟疫之地", ["Westfall"] = "西部荒野", ["Wetlands"] = "湿地", ["Winterspring"] = "冬泉谷", ["Zul'Farrak"] = "祖尔法拉克", ["Zul'Gurub"] = "祖尔格拉布", ["Plaguewood"] = "病木林", -- ["Auchindoun"] = true, -- ["The Bone Wastes"] = true, -- ["Coilfang Reservoir"] = true, -- ["Auchenai Crypts"] = true, -- ["Mana-Tombs"] = true, -- ["Shadow Labyrinth"] = true, -- ["Sethekk Halls"] = true, -- ["Hellfire Ramparts"] = true, -- ["The Blood Furnace"] = true, -- ["The Shattered Halls"] = true, -- ["Magtheridon's Lair"] = true, -- ["The Slave Pens"] = true, -- ["The Underbog"] = true, -- ["The Steamvault"] = true, -- ["Serpentshrine Cavern"] = true, -- ["Blade's Edge Mountains"] = true, -- ["Gruul's Lair"] = true, -- ["Netherstorm"] = true, -- ["The Mechanar"] = true, -- ["The Botanica"] = true, -- ["The Arcatraz"] = true, -- ["Eye of the Storm"] = true, -- Burning Crusade ["Azuremyst Isle"] = "秘蓝岛", --some of the following tranlation need to checked after the release ["Bloodmyst Isle"] = "秘血岛", ["Eversong Woods"] = "永歌森林", ["Ghostlands"] = "鬼魂之地", ["The Exodar"] = "埃克索达", ["Shadowmoon Valley"] = "影月峡谷", ["Silvermoon City"] = "银月城", ["Black Temple"] = "黑暗神庙", ["Terokkar Forest"] = "泰罗卡森林", ["Auchindoun"] = "奥金顿", ["Hellfire Peninsula"] = "地狱火半岛", ["The Dark Portal"] = "黑暗之门", ["Hellfire Citadel"] = "地狱火堡垒", ["Nagrand"] = "纳格兰", ["Zangarmarsh"] = "赞加沼泽", ["Coilfang Reservoir"] = "盘牙湖泊", ["Blade's Edge Mountains"] = "刀锋山", ["Gruul's Lair"] = "格鲁尔的巢穴", ["Netherstorm"] = "虚空风暴", ["Tempest Keep"] = "风暴要塞", ["Shattrath City"] = "沙尔特拉城", ["Karazhan"] = "卡拉赞", ["Caverns of Time"] = "时光之穴", -- ["Zul'Aman"] = true, } end) BabbleZone:RegisterTranslations("zhTW", function() return { ["Ahn'Qiraj"] = "安其拉", ["Alterac Mountains"] = "奧特蘭克山脈", ["Alterac Valley"] = "奧特蘭克山谷", ["Arathi Basin"] = "阿拉希盆地", ["Arathi Highlands"] = "阿拉希高地", ["Ashenvale"] = "梣谷", ["Auberdine"] = "奧伯丁", ["Azshara"] = "艾薩拉", ["Badlands"] = "荒蕪之地", ["The Barrens"] = "貧瘠之地", ["Blackfathom Deeps"] = "黑暗深淵", ["Blackrock Depths"] = "黑石深淵", ["Blackrock Mountain"] = "黑石山", ["Blackrock Spire"] = "黑石塔", ["Blackwing Lair"] = "黑翼之巢", ["Blasted Lands"] = "詛咒之地", ["Booty Bay"] = "藏寶海灣", ["Burning Steppes"] = "燃燒平原", ["Darkshore"] = "黑海岸", ["Darnassus"] = "達納蘇斯", ["The Deadmines"] = "死亡礦坑", ["Deadwind Pass"] = "逆風小徑", ["Deeprun Tram"] = "礦道地鐵", ["Desolace"] = "淒涼之地", ["Dire Maul"] = "厄運之槌", ["Dire Maul (West)"] = "厄運之槌(西)", ["Dire Maul (North)"] = "厄運之槌(北)", ["Dire Maul (East)"] = "厄運之槌(東)", ["Dun Morogh"] = "丹莫洛", ["Durotar"] = "杜洛塔", ["Duskwood"] = "暮色森林", ["Dustwallow Marsh"] = "塵泥沼澤", ["Eastern Plaguelands"] = "東瘟疫之地", ["Elwynn Forest"] = "艾爾文森林", ["Everlook"] = "永望鎮", ["Felwood"] = "費伍德森林", ["Feralas"] = "菲拉斯", ["The Forbidding Sea"] = "禁忌之海", ["Gadgetzan"] = "加基森", ["Gates of Ahn'Qiraj"] = "安其拉之門", ["Gnomeregan"] = "諾姆瑞根", ["The Great Sea"] = "無盡之海", ["Grom'gol Base Camp"] = "格羅姆高營地", ["Hall of Legends"] = "傳說大廳", ["Hillsbrad Foothills"] = "希爾斯布萊德丘陵", ["The Hinterlands"] = "辛特蘭", ["Hyjal"] = "海加爾山", ["Ironforge"] = "鐵爐堡", ["Loch Modan"] = "洛克莫丹", ["Lower Blackrock Spire"] = "黑石塔(下層)", ["Maraudon"] = "瑪拉頓", ["Menethil Harbor"] = "米奈希爾港", ["Molten Core"] = "熔火之心", ["Moonglade"] = "月光林地", ["Mulgore"] = "莫高雷", ["Naxxramas"] = "納克薩瑪斯", ["Onyxia's Lair"] = "奧妮克希亞的巢穴", ["Orgrimmar"] = "奧格瑪", ["Ratchet"] = "棘齒城", ["Ragefire Chasm"] = "怒焰裂谷", ["Razorfen Downs"] = "剃刀高地", ["Razorfen Kraul"] = "剃刀沼澤", ["Redridge Mountains"] = "赤脊山", ["Ruins of Ahn'Qiraj"] = "安其拉廢墟", ["Scarlet Monastery"] = "血色修道院", ["Scholomance"] = "通靈學院", ["Searing Gorge"] = "灼熱峽谷", ["Shadowfang Keep"] = "影牙城堡", ["Silithus"] = "希利蘇斯", ["Silverpine Forest"] = "銀松森林", ["The Stockade"] = "監獄", ["Stonetalon Mountains"] = "石爪山脈", ["Stormwind City"] = "暴風城", ["Stranglethorn Vale"] = "荊棘谷", ["Stratholme"] = "斯坦索姆", ["Swamp of Sorrows"] = "悲傷沼澤", ["Tanaris"] = "塔納利斯", ["Teldrassil"] = "泰達希爾", ["Temple of Ahn'Qiraj"] = "安其拉神廟", ["The Temple of Atal'Hakkar"] = "阿塔哈卡神廟", ["Theramore Isle"] = "塞拉摩島", ["Thousand Needles"] = "千針石林", ["Thunder Bluff"] = "雷霆崖", ["Tirisfal Glades"] = "提里斯法林地", ["Uldaman"] = "奧達曼", ["Un'Goro Crater"] = "安戈洛環形山", ["Undercity"] = "幽暗城", ["Upper Blackrock Spire"] = "黑石塔(上層)", ["Wailing Caverns"] = "哀嚎洞穴", ["Warsong Gulch"] = "戰歌峽谷", ["Western Plaguelands"] = "西瘟疫之地", ["Westfall"] = "西部荒野", ["Wetlands"] = "濕地", ["Winterspring"] = "冬泉谷", ["Zul'Farrak"] = "祖爾法拉克", ["Zul'Gurub"] = "祖爾格拉布", ["Plaguewood"] = "病木林", -- ["Auchindoun"] = true, -- ["The Bone Wastes"] = true, -- ["Coilfang Reservoir"] = true, -- ["Auchenai Crypts"] = true, -- ["Mana-Tombs"] = true, -- ["Shadow Labyrinth"] = true, -- ["Sethekk Halls"] = true, -- ["Hellfire Ramparts"] = true, -- ["The Blood Furnace"] = true, -- ["The Shattered Halls"] = true, -- ["Magtheridon's Lair"] = true, -- ["The Slave Pens"] = true, -- ["The Underbog"] = true, -- ["The Steamvault"] = true, -- ["Serpentshrine Cavern"] = true, -- ["Blade's Edge Mountains"] = true, -- ["Gruul's Lair"] = true, -- ["Netherstorm"] = true, -- ["The Mechanar"] = true, -- ["The Botanica"] = true, -- ["The Arcatraz"] = true, -- ["Eye of the Storm"] = true, -- Burning Crusade ["Azuremyst Isle"] = "秘藍島", ["Bloodmyst Isle"] = "秘血島", ["Eversong Woods"] = "永歌森林", ["Ghostlands"] = "鬼魂之地", ["The Exodar"] = "埃克索達", ["Shadowmoon Valley"] = "影月峽谷", ["Silvermoon City"] = "銀月城", ["Black Temple"] = "黑暗神廟", ["Terokkar Forest"] = "泰羅卡森林", ["Auchindoun"] = "奧金頓", ["Hellfire Peninsula"] = "地獄火半島", ["The Dark Portal"] = "黑暗之門", ["Hellfire Citadel"] = "地獄火堡壘", ["Nagrand"] = "納格蘭", ["Zangarmarsh"] = "贊加沼澤", ["Coilfang Reservoir"] = "盤牙湖泊", ["Blade's Edge Mountains"] = "刀鋒山", ["Gruul's Lair"] = "格魯爾的巢穴", ["Netherstorm"] = "虛空風暴", ["Tempest Keep"] = "風暴要塞", ["Shattrath City"] = "沙爾特拉城", ["Karazhan"] = "卡拉贊", ["Caverns of Time"] = "時光洞穴", -- ["Zul'Aman"] = true, } end) BabbleZone:RegisterTranslations("koKR", function() return { ["Ahn'Qiraj"] = "안퀴라즈", ["Alterac Mountains"] = "알터랙 산맥", ["Alterac Valley"] = "알터랙 계곡", ["Arathi Basin"] = "아라시 분지", ["Arathi Highlands"] = "아라시 고원", ["Ashenvale"] = "잿빛 골짜기", ["Auberdine"] = "아우버다인", ["Azshara"] = "아즈샤라", ["Badlands"] = "황야의 땅", ["The Barrens"] = "불모의 땅", ["Blackfathom Deeps"] = "검은 심연의 나락", ["Blackrock Depths"] = "검은바위 나락", ["Blackrock Mountain"] = "검은바위 산", ["Blackrock Spire"] = "검은바위 첨탑", ["Blackwing Lair"] = "검은날개 둥지", ["Blasted Lands"] = "저주받은 땅", ["Booty Bay"] = "무법항", ["Burning Steppes"] = "불타는 평원", ["Darkshore"] = "어둠의 해안", ["Darnassus"] = "다르나서스", ["The Deadmines"] = "죽음의 폐광", ["Deadwind Pass"] = "죽음의 고개", ["Deeprun Tram"] = "깊은굴 지하철", ["Desolace"] = "잊혀진 땅", ["Dire Maul"] = "혈투의 전장", ["Dire Maul (East)"] = "혈투의 전장 동부", ["Dire Maul (West)"] = "혈투의 전장 서부", ["Dire Maul (North)"] = "혈투의 전장 북부", ["Dun Morogh"] = "던 모로", ["Durotar"] = "듀로타", ["Duskwood"] = "그늘숲", ["Dustwallow Marsh"] = "먼지진흙 습지대", ["Eastern Plaguelands"] = "동부 역병지대", ["Elwynn Forest"] = "엘윈 숲", ["Everlook"] = "눈망루 마을", ["Felwood"] = "악령의 숲", ["Feralas"] = "페랄라스", ["The Forbidding Sea"] = "성난폭풍 해안", ["Gadgetzan"] = "가젯잔", ["Gates of Ahn'Qiraj"] = "안퀴라즈 성문", ["Gnomeregan"] = "놈리건", ["The Great Sea"] = "대해", ["Grom'gol Base Camp"] = "그롬골 주둔지", ["Hall of Legends"] = "용사의 전당", ["Hillsbrad Foothills"] = "힐스브래드 구릉지", ["The Hinterlands"] = "동부 내륙지", ["Hyjal"] = "하이잘", ["Ironforge"] = "아이언포지", ["Loch Modan"] = "모단 호수", ["Lower Blackrock Spire"] = "검은바위 첨탑 하층", ["Maraudon"] = "마라우돈", ["Menethil Harbor"] = "메네실 항구", ["Molten Core"] = "화산 심장부", ["Moonglade"] = "달의 숲", ["Mulgore"] = "멀고어", ["Naxxramas"] = "낙스라마스", ["Onyxia's Lair"] = "오닉시아의 둥지", ["Orgrimmar"] = "오그리마", ["Ratchet"] = "톱니항", ["Ragefire Chasm"] = "성난 불길협곡", ["Razorfen Downs"] = "가시덩쿨 구릉", ["Razorfen Kraul"] = "가시덩쿨 우리", ["Redridge Mountains"] = "붉은마루 산맥", ["Ruins of Ahn'Qiraj"] = "안퀴라즈 폐허", ["Scarlet Monastery"] = "붉은 십자군 수도원", ["Scholomance"] = "스칼로맨스", ["Searing Gorge"] = "이글거리는 협곡", ["Shadowfang Keep"] = "그림자 송곳니 성채", ["Silithus"] = "실리더스", ["Silverpine Forest"] = "은빛소나무 숲", ["The Stockade"] = "지하감옥", ["Stonetalon Mountains"] = "돌발톱 산맥", ["Stormwind City"] = "스톰윈드", ["Stranglethorn Vale"] = "가시덤불 골짜기", ["Stratholme"] = "스트라솔름", ["Swamp of Sorrows"] = "슬픔의 늪", ["Tanaris"] = "타나리스", ["Teldrassil"] = "텔드랏실", ["Temple of Ahn'Qiraj"] = "안퀴라즈 사원", ["The Temple of Atal'Hakkar"] = "아탈학카르 신전", ["Theramore Isle"] = "테라모어 섬", ["Thousand Needles"] = "버섯구름 봉우리", ["Thunder Bluff"] = "썬더 블러프", ["Tirisfal Glades"] = "티리스팔 숲", ["Uldaman"] = "울다만", ["Un'Goro Crater"] = "운고로 분화구", ["Undercity"] = "언더시티", ["Upper Blackrock Spire"] = "검은바위 첨탑 상층", ["Wailing Caverns"] = "통곡의 동굴", ["Warsong Gulch"] = "전쟁노래 협곡", ["Western Plaguelands"] = "서부 역병지대", ["Westfall"] = "서부 몰락지대", ["Wetlands"] = "저습지", ["Winterspring"] = "여명의 설원", ["Zul'Farrak"] = "줄파락", ["Zul'Gurub"] = "줄구룹", -- Burning Crusade -- Subzones used for displaying instances. ["Plaguewood"] = "Plaguewood", -- check ["Hellfire Citadel"] = "지옥불 성채", ["Auchindoun"] = "아킨둔", ["The Bone Wastes"] = "해골 무덤", -- Substitute for Auchindoun, since this is what shows on the minimap. ["Coilfang Reservoir"] = "갈퀴송곳니 저수지", ["Azuremyst Isle"] = "하늘안개 섬", ["Bloodmyst Isle"] = "핏빛안개 섬", ["Eversong Woods"] = "영원노래 숲", ["Ghostlands"] = "유령의 땅", ["The Exodar"] = "엑소다르", ["Silvermoon City"] = "실버문", ["Shadowmoon Valley"] = "어둠달 골짜기", ["Black Temple"] = "검은 사원", ["Terokkar Forest"] = "테로카르 숲", ["Auchenai Crypts"] = "아키나이 납골당", ["Mana-Tombs"] = "마나 무덤", ["Shadow Labyrinth"] = "어둠의 미궁", ["Sethekk Halls"] = "세데크 전당", ["Hellfire Peninsula"] = "지옥불 반도", ["The Dark Portal"] = "어둠의 문", ["Hellfire Ramparts"] = "지옥불 성루", ["The Blood Furnace"] = "피의 용광로", ["The Shattered Halls"] = "파괴된 전당", ["Magtheridon's Lair"] = "마그테리돈의 둥지", ["Nagrand"] = "나그란드", ["Zangarmarsh"] = "장가르 습지대", ["The Slave Pens"] = "강제 수용소", ["The Underbog"] = "지하수렁", ["The Steamvault"] = "증기 저장고", ["Serpentshrine Cavern"] = "불뱀 제단", ["Blade's Edge Mountains"] = "칼날 산맥", ["Gruul's Lair"] = "그룰의 둥지", ["Netherstorm"] = "황천의 폭풍", ["Tempest Keep"] = "폭풍우 요새", ["The Mechanar"] = "메카나르", ["The Botanica"] = "신록의 정원", ["The Arcatraz"] = "알카트라즈", ["Eye of the Storm"] = "폭풍의 눈", ["Shattrath City"] = "샤트라스", ["Karazhan"] = "카라잔", ["Caverns of Time"] = "시간의 동굴", ["Zul'Aman"] = "줄아만", } end) BabbleZone:Debug() BabbleZone:SetStrictness(true) AceLibrary:Register(BabbleZone, MAJOR_VERSION, MINOR_VERSION) BabbleZone = nil
gpl-3.0
iranianhacker40/ARCHON-TEAM
plugins/lock_badword.lua
13
3182
local function run(msg, matches) if msg.to.type == 'chat' then if is_momod(msg) then return end local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['lock_badw'] then lock_adds = data[tostring(msg.to.id)]['settings']['lock_badw'] end end end local chat = get_receiver(msg) local user = "user#id"..msg.from.id if lock_adds == "yes" then send_large_msg(chat, 'Badwords is not allowed here!!') chat_del_user(chat, user, ok_cb, true) end end end return { patterns = { "(ک*س)$", "کیر", "کص", "کــــــــــیر", "کــــــــــــــــــــــــــــــیر", "کـیـــــــــــــــــــــــــــــــــــــــــــــــــــر", "ک×یر", "ک÷یر", "ک*ص", "کــــــــــیرر", "kir", "kos", "گوساله", "gosale", "gusale", -- this is not full! you can do it yourself ! }, run = run } -- -_-_-_-_-_-_-_-_-_- ||-_-_-_-_-_ || ||-_-_-_-_-_ -- || || || || -- || || || || -- || || || || -- || ||-_-_-_-_-_ || ||-_-_-_-_-_ -- || || || || -- || || || || -- || || || || -- || ||-_-_-_-_-_ ||-_-_-_-_-_ ||-_-_-_-_-_ -- -- -- /\ /\ /-_-_-_-_-_ ||-_-_-_-_-_ ||-_-_-_-_-_ -- ||\\ //|| //\\ || //|| //\\ // || || // -- || \\ // || // \\ || // || // \\ // || || // -- || \\ // || // \\ || // || // \\ || || || // -- || \\ // || //______\\ || // || //______\\ || -_-_-_- ||-_-_-_-_-_ || // -- || \\ // || // \\ || // || // \\ || || || || \\ -- || \\ // || // \\ || // || // \\ \\ || || || \\ -- || \\// || // \\ ||// || // \\ \\-_-_-_-_-|| ||-_-_-_-_-_ || \\ -- -- -- ||-_-_-_- || || || //-_-_-_-_-_- -- || || || || || // -- ||_-_-_|| || || || // -- || || || || \\ -- || || \\ // \\ -- || || \\ // // -- || ||-_-_-_-_ \\-_-_-_-// -_-_-_-_-_-// -- --By @ali_ghoghnoos --@telemanager_ch
gpl-2.0
NerdWalletOSS/Q
OPERATORS/LOAD_CSV/test/performance_testing/gen_csv_metadata_file.lua
1
6967
--require 'Q/UTILS/lua/globals' local qconsts = require 'Q/UTILS/lua/q_consts' -- table for random functions local random_func = {} local fns = {} --to convert row (table) into comma separated line local to_csv = function (tt) local s = "" for _,p in ipairs(tt) do s = s .. "," .. p end return(string.sub(s, 2)) end --placing random seed once at start for generating random no. each time math.randomseed(os.time()) random_func.random_int8_t = function () return math.random(1,127) end random_func.random_int16_t = function () return math.random(1,32767) end random_func.random_int32_t = function () return math.random(1,2147483647) end random_func.random_float = function () return math.random(100000,900000) / 10 end random_func.random_uint64_t = function () return math.random(0,1) end local charset = {} -- qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890 for i = 48, 57 do table.insert(charset, string.char(i)) end for i = 65, 90 do table.insert(charset, string.char(i)) end for i = 97, 122 do table.insert(charset, string.char(i)) end random_func.random_SC = function(length_inp) local length = length_inp if length > 0 then return random_func.random_SC(length - 1) .. charset[math.random(1, #charset)] end return "" end random_func.random_SV = function(size) local random_len = math.random(1,size) local string = random_func.random_SC(random_len) return string end --generating maximum specified unique strings local dict_size_unique_string = function (max_str_size, max_idx) local str local unique_strings_table = {'""'} --for storing unique strings in table local reverse_storing = {'""'} --for searching string in 0(n) time local idx = 2 repeat str = random_func.random_SV(max_str_size-1) if(reverse_storing[str] == nil) then --IF generated string is not in the table then insert in both the tables unique_strings_table[idx] = str reverse_storing[str] = idx idx = idx + 1 end until idx == max_idx + 1 return unique_strings_table end --generating unique strings for each varchar column fns.generate_unique_varchar_strings = function(meta_info) local unique_string_tables = {} local is_varchar_col = false for i=1, #meta_info do if meta_info[i]['qtype']=='SV' then is_varchar_col= true --calculating possible unique string limit local exp_unique_strings= 0 for j=1, meta_info[i]['max_width']-1 do exp_unique_strings = exp_unique_strings + math.pow(#charset, j) end --print("For string length ",meta_info[i]['width']-1," value is ",exp_unique_strings) -- before gen unique strings checking if max_unique_value is within possible limit assert(meta_info[i]['max_unique_values'] <= exp_unique_strings,"Specified Unique string limit is beyond possible limit value...") unique_string_tables[i] = dict_size_unique_string(meta_info[i]['max_width'],meta_info[i]['max_unique_values']) end end if is_varchar_col == false then return nil end return unique_string_tables end --generating metadata table(returns metadata table generated) fns.generate_metadata = function(meta_info) local metadata_table= {} local idx=1 local col_name= 'col' --for giving names to each column for i=1, #meta_info do for k = 1 , meta_info[i]['column_count'] do metadata_table[idx] = {} metadata_table[idx]['name'] = col_name ..idx metadata_table[idx]['qtype'] = meta_info[i]['qtype'] metadata_table[idx]['has_nulls'] = meta_info[i]['has_nulls'] if meta_info[i]['qtype']== 'SC' then metadata_table[idx]['width'] = meta_info[i]['width'] elseif meta_info[i]['qtype']== 'SV' then metadata_table[idx]['max_width'] = meta_info[i]['max_width'] metadata_table[idx]['add'] = meta_info[i]['add'] metadata_table[idx]['dict'] = "D"..i metadata_table[idx]['unique_table_id']= i metadata_table[idx]['max_unique_values'] = meta_info[i]['max_unique_values'] if k==1 then metadata_table[idx]['is_dict'] = false else metadata_table[idx]['is_dict'] = true end end idx = idx +1 end end --pretty.dump(metadata_table) return metadata_table end --function to fill the chunk_print_size table with data local function fill_table(column_list, chunk_print_size,unique_string_tables) local file_data = { } local col_length = #column_list for ind=1, chunk_print_size do --fill table data file_data[ind] = {} for j=1, col_length do if column_list[j]['qtype']=='SC' then local func ='random_'..column_list[j]['qtype'] local size = column_list[j]['width']-1 table.insert(file_data[ind],random_func[func](size)) elseif column_list[j]['qtype']=='SV' then local random_no = math.random(1,column_list[j]['max_unique_values']) local dict_no = column_list[j]['unique_table_id'] assert(unique_string_tables~=nil,"Attempting to use unique string table which doesnt exists") table.insert(file_data[ind],unique_string_tables[dict_no][random_no]) else local data_type_short_code = column_list[j]['qtype'] local func ='random_'..qconsts.qtypes[data_type_short_code]['ctype'] table.insert(file_data[ind],random_func[func]()) end end end return file_data end --function to write the table data into csv file and then empty the table local write_and_empty_table = function (chunk_print_size, file_data, file) local final_csv_string = '' for ind=1, chunk_print_size do --write file data and empty table data local csv_string = to_csv(file_data[ind]) final_csv_string = final_csv_string..csv_string.."\n" file_data[ind]=nil end file:write(final_csv_string) end --generating csv file based on metadata (this function returns no of rows generated) fns.generate_csv_file = function(csv_file_name, metadata_table, row_count, chunk_print_size,unique_string_tables) local file = assert(io.open(csv_file_name, 'w')) local no_of_chunks = math.floor(row_count/chunk_print_size) local chunks = 1 local table_data = { } while( chunks <= no_of_chunks) do table_data = fill_table(metadata_table, chunk_print_size, unique_string_tables) write_and_empty_table(chunk_print_size, table_data, file) print("Written "..chunk_print_size*chunks.." rows in "..csv_file_name.." file") chunks = chunks + 1 end --for the last chunk local last_chunk_rows = no_of_chunks*chunk_print_size local last_chunk_print_size = 0 if(last_chunk_rows < row_count)then last_chunk_print_size = row_count - last_chunk_rows table_data = fill_table(metadata_table, last_chunk_print_size, unique_string_tables) write_and_empty_table(last_chunk_print_size, table_data, file) end file:close() --closing csv file end return fns
mit
codergreen/ValyriaTear
dat/config/fonts.lua
6
1468
-- The fonts table is used to load the available fonts in game. -- One and one only font should be set as default. -- If no valid font is defined or if the default one is invalid, the game won't start -- and log why. fonts = { -- Text style internal name = { "font file path", font size } -- TODO: Rename the text style to some non size dependant name. ["title20"] = {font = "img/fonts/LinLibertine_aBS.ttf", size = 18}, ["title22"] = {font = "img/fonts/LinLibertine_aBS.ttf", size = 20}, ["title24"] = {font = "img/fonts/LinLibertine_aBS.ttf", size = 22}, ["title28"] = {font = "img/fonts/LinLibertine_aBS.ttf", size = 24}, ["text18"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 16}, ["text20"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 18}, ["text22"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 20}, ["text24"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 22}, ["text24.2"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 24}, ["text26"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 26}, ["text28"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 28}, ["text36"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 36}, ["text48"] = {font = "img/fonts/LinBiolinum_RBah.ttf", size = 48}, -- Map title font ["map_title"] = {font = "img/fonts/Berenika-Oblique.ttf", size = 30} } -- The font is white with a black shadow anyway. font_default = "text22";
gpl-2.0
vgire/nn
SpatialDropout.lua
33
1453
local SpatialDropout, Parent = torch.class('nn.SpatialDropout', 'nn.Module') function SpatialDropout:__init(p) Parent.__init(self) self.p = p or 0.5 self.train = true self.noise = torch.Tensor() end function SpatialDropout:updateOutput(input) self.output:resizeAs(input):copy(input) if self.train then if input:dim() == 4 then self.noise:resize(input:size(1), input:size(2), 1, 1) elseif input:dim() == 3 then self.noise:resize(input:size(1), 1, 1) else error('Input must be 4D (nbatch, nfeat, h, w) or 3D (nfeat, h, w)') end self.noise:bernoulli(1-self.p) -- We expand the random dropouts to the entire feature map because the -- features are likely correlated accross the map and so the dropout -- should also be correlated. self.output:cmul(torch.expandAs(self.noise, input)) else self.output:mul(1-self.p) end return self.output end function SpatialDropout:updateGradInput(input, gradOutput) if self.train then self.gradInput:resizeAs(gradOutput):copy(gradOutput) self.gradInput:cmul(torch.expandAs(self.noise, input)) -- simply mask the gradients with the noise vector else error('backprop only defined while training') end return self.gradInput end function SpatialDropout:setp(p) self.p = p end function SpatialDropout:__tostring__() return string.format('%s(%f)', torch.type(self), self.p) end
bsd-3-clause
TheAnswer/FirstTest
bin/scripts/items/objects/clothing/dresses/dress34.lua
1
2280
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. dress34 = Clothing:new { objectName = "Dress 34", templateName = "dress_s34", objectCRC = "167499282", objectType = DRESS, equipped = "0", itemMask = HUMANOID_FEMALES }
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/naboo/npcs/gungan/mordranGunganExile.lua
1
4573
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. mordranGunganExile = Creature:new { objectName = "mordranGunganExile", -- Lua Object Name creatureType = "NPC", faction = "Borvo", gender = "", speciesName = "mordran_gungan_exile", stfName = "mob/creature_names", objectCRC = 1780356929, socialGroup = "gungan", level = 40, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 11300, healthMin = 9300, strength = 0, constitution = 0, actionMax = 11300, actionMin = 9300, quickness = 0, stamina = 0, mindMax = 11300, mindMin = 9300, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = 0, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 1, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 345, weaponMaxDamage = 400, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "gunganAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(mordranGunganExile, 1780356929) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/skills/creatureSkills/corellia/creatures/sandPantherAttacks.lua
1
3718
sandPantherAttack1 = { attackname = "sandPantherAttack1", animation = "creature_attack_light", requiredWeaponType = NONE, range = 7, damageRatio = 1.2, speedRatio = 4, arearange = 7, accuracyBonus = 0, knockdownChance = 0, postureDownChance = 0, postureUpChance = 0, dizzyChance = 50, blindChance = 0, stunChance = 0, intimidateChance = 0, CbtSpamBlock = "attack_block", CbtSpamCounter = "attack_counter", CbtSpamEvade = "attack_evade", CbtSpamHit = "attack_hit", CbtSpamMiss = "attack_miss", invalidStateMask = 0, invalidPostures = "", instant = 0 } AddRandomPoolAttackTargetSkill(sandPantherAttack1) --------------------------------------------------------------------------------------- sandPantherAttack2 = { attackname = "sandPantherAttack2", animation = "creature_attack_light", requiredWeaponType = NONE, range = 7, damageRatio = 1.2, speedRatio = 4, arearange = 7, accuracyBonus = 0, knockdownChance = 0, postureDownChance = 0, postureUpChance = 0, dizzyChance = 0, blindChance = 0, stunChance = 50, intimidateChance = 0, CbtSpamBlock = "attack_block", CbtSpamCounter = "attack_counter", CbtSpamEvade = "attack_evade", CbtSpamHit = "attack_hit", CbtSpamMiss = "attack_miss", invalidStateMask = 0, invalidPostures = "", instant = 0 } AddRandomPoolAttackTargetSkill(sandPantherAttack2) --------------------------------------------------------------------------------------- sandPantherAttack3 = { attackname = "sandPantherAttack3", animation = "creature_attack_light", requiredWeaponType = NONE, range = 7, damageRatio = 1.2, speedRatio = 4, arearange = 7, accuracyBonus = 0, knockdownChance = 0, postureDownChance = 0, postureUpChance = 0, dizzyChance = 0, blindChance = 50, stunChance = 0, intimidateChance = 0, CbtSpamBlock = "attack_block", CbtSpamCounter = "attack_counter", CbtSpamEvade = "attack_evade", CbtSpamHit = "attack_hit", CbtSpamMiss = "attack_miss", invalidStateMask = 0, invalidPostures = "", instant = 0 } AddRandomPoolAttackTargetSkill(sandPantherAttack3) --------------------------------------------------------------------------------------- sandPantherAttack4 = { attackname = "sandPantherAttack4", animation = "creature_attack_light", requiredWeaponType = NONE, range = 7, damageRatio = 1.2, speedRatio = 4, arearange = 7, accuracyBonus = 0, knockdownChance = 0, postureDownChance = 0, postureUpChance = 0, dizzyChance = 0, blindChance = 0, stunChance = 0, intimidateChance = 50, CbtSpamBlock = "attack_block", CbtSpamCounter = "attack_counter", CbtSpamEvade = "attack_evade", CbtSpamHit = "attack_hit", CbtSpamMiss = "attack_miss", invalidStateMask = 0, invalidPostures = "", instant = 0 } AddRandomPoolAttackTargetSkill(sandPantherAttack4) ---------------------------------------------------------------------------------------
lgpl-3.0
Hammerspoon/hammerspoon
extensions/application/test_application.lua
4
7507
hs.application = require("hs.application") hs.dockicon = require("hs.dockicon") menuTestValue = nil function testInitWithPidFailures() assertIsNil(hs.application.applicationForPID(1)) return success() end function testInitWithPid() local apps = hs.application.runningApplications() for _,app in pairs(apps) do local pidApp = hs.application.applicationForPID(app:pid()) if pidApp == nil then assertIsEqual(app:name(), nil) -- works in XCode now, but still not in GithubActions end assertIsEqual(app:name(), pidApp:name()) end return success() end function testAttributesFromBundleID() local appName = "Safari" local appPath = "/Applications/Safari.app" local bundleID = "com.apple.Safari" assertTrue(hs.application.launchOrFocusByBundleID(bundleID)) local app = hs.application.applicationsForBundleID(bundleID)[1] assertIsEqual(appName, app:name()) assertIsEqual(appPath, app:path()) assertIsString(tostring(app)) assertIsEqual(appName, hs.application.nameForBundleID(bundleID)) assertIsEqual(appPath, hs.application.pathForBundleID(bundleID)) assertIsEqual("Safari", hs.application.infoForBundleID("com.apple.Safari")["CFBundleExecutable"]) assertIsNil(hs.application.infoForBundleID("some.nonsense")) assertIsEqual("Safari", hs.application.infoForBundlePath("/Applications/Safari.app")["CFBundleExecutable"]) assertIsNil(hs.application.infoForBundlePath("/C/Windows/System32/lol.exe")) app:kill() return success() end function testBasicAttributes() local appName = "Hammerspoon" local bundleID = "org.hammerspoon.Hammerspoon" local currentPID = hs.processInfo.processID assertIsNil(hs.application.applicationForPID(1)) local app = hs.application.applicationForPID(currentPID) assertIsEqual(bundleID, app:bundleID()) assertIsEqual(appName, app:name()) assertIsEqual(appName, app:title()) assertIsEqual(currentPID, app:pid()) assertFalse(app:isUnresponsive()) -- This is disabled for now, not sure why it's failing -- hs.dockicon.show() -- hs.timer.usleep(200000) -- assertIsEqual(1, app:kind()) -- hs.dockicon.hide() -- hs.timer.usleep(200000) -- assertIsEqual(0, app:kind()) return success() end function testActiveAttributes() -- need to use application.watcher for testing these async events local appName = "Stickies" local app = hs.application.open(appName, 0, true) assertTrue(app:isRunning()) assertTrue(app:activate()) assertTrue(app:hide()) assertTrue(app:isHidden()) assertTrue(app:unhide()) assertFalse(app:isHidden()) assertTrue(app:activate()) local menuPathBlue = {"Color", "Blue"} local menuPathGreen = {"Color", "Green"} assertTrue(app:selectMenuItem(menuPathBlue)) app:selectMenuItem({"Color"}) assertTrue(app:findMenuItem(menuPathBlue).ticked) assertTrue(app:selectMenuItem(menuPathGreen)) app:selectMenuItem({"Color"}) assertFalse(app:findMenuItem(menuPathBlue).ticked) assertIsEqual(appName, app:getMenuItems()[1].AXTitle) return success() end function testMetaTable() -- hs.application's userdata is not aligned with other HS types (via LuaSkin) because it is old and special -- the `__type` field is not currently on hs.application object metatables like everything else -- this test should pass but can wait for rewrite local app = launchAndReturnAppFromBundleID("com.apple.Safari") assertIsUserdataOfType("hs.application", app) return success() end function testFrontmostApplication() hs.openConsole() local app = hs.application.frontmostApplication() app:activate() assertIsNotNil(app) assertTrue(app:isFrontmost()) assertTrue(app:setFrontmost()) return success() end function testRunningApplications() local apps = hs.application.runningApplications() assertIsEqual("table", type(apps)) assertGreaterThan(1, #apps) return success() end function testHiding() hs.application.open("Stickies", 5, true) return success() end function testHidingValues() local app = hs.application.get("Stickies") assertIsNotNil(app) assertTrue(app:isRunning()) assertFalse(app:isHidden()) app:hide() hs.timer.usleep(500000) assertTrue(app:isHidden()) app:unhide() hs.timer.usleep(500000) assertFalse(app:isHidden()) app:kill9() return success() end function testKilling() local app = hs.application.open("Audio MIDI Setup", 5, true) return success() end function testKillingValues() local app = hs.application.get("Audio MIDI Setup") assertIsNotNil(app) assertTrue(app:isRunning()) app:kill() hs.timer.usleep(500000) assertFalse(app:isRunning()) return success() end function testForceKilling() hs.application.open("Calculator", 5, true) return success() end function testForceKillingValues() local app = hs.application.get("Calculator") assertIsNotNil(app) assertTrue(app:isRunning()) app:kill9() hs.timer.usleep(500000) assertFalse(app:isRunning()) return success() end function testWindows() local dock = hs.application.get("Dock") assertIsNil(dock:mainWindow()) hs.application.open("Grapher", 5, true) return success() end function testWindowsValues() local app = hs.application.get("Grapher") assertIsNotNil(app) local wins = app:allWindows() assertIsEqual("table", type(wins)) assertIsEqual(1, #wins) local win = app:focusedWindow() assertIsEqual("Grapher", win:application():name()) app:kill() return success() end function testMenus() local app = hs.application.get("Hammerspoon") local menus = app:getMenuItems() assertIsTable(menus) assertIsEqual("Hammerspoon", menus[1]["AXTitle"]) local item = app:findMenuItem({"Edit", "Cut"}) assertIsTable(item) assertIsBoolean(item["enabled"]) assertIsNil(app:findMenuItem({"Foo", "Bar"})) item = app:findMenuItem("Cut") assertIsTable(item) assertIsBoolean(item["enabled"]) assertIsNil(app:findMenuItem("Foo")) assertTrue(app:selectMenuItem({"Edit", "Select All"})) assertIsNil(app:selectMenuItem({"Edit", "No Such Menu Item"})) assertTrue(app:selectMenuItem("Select All")) assertIsNil(app:selectMenuItem("Some Nonsense")) app = hs.application.get("Dock") app:activate(true) menus = app:getMenuItems() assertIsNil(menus) return success() end function testMenusAsync() local app = hs.application.get("Hammerspoon") local value = app:getMenuItems(function(menutable) menuTestValue = menutable end) assertIsUserdataOfType("hs.application", value) return success() end function testMenusAsyncValues() assertIsTable(menuTestValue) assertIsEqual("Hammerspoon", menuTestValue[1]["AXTitle"]) return success() end function testUTI() local bundle = hs.application.defaultAppForUTI('public.jpeg') assertIsEqual("com.apple.Preview", bundle) return success() end function testLocalizationFunctions() local appPath = "/Applications/Safari.app" local bundleID = "com.apple.Safari" local localizationsForBundleID = hs.application.localizationsForBundleID(bundleID) assertIsTable(localizationsForBundleID) local preferredLocalizationsForBundleID = hs.application.preferredLocalizationsForBundleID(bundleID) assertIsTable(preferredLocalizationsForBundleID) local localizationsForBundlePath = hs.application.localizationsForBundlePath(appPath) assertIsTable(localizationsForBundlePath) local preferredLocalizationsForBundlePath = hs.application.preferredLocalizationsForBundlePath(appPath) assertIsTable(preferredLocalizationsForBundlePath) return success() end
mit
Mohammadrezar/telediamond
plugins/stats.lua
1
4030
do -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..' ['..user_id..']' return user_info end local function chat_stats(receiver, chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = 'Users in this chat \n' for k,user in pairs(users_info) do text = text..user.name..' = '..user.msgs..'\n' end local file = io.open("./groups/lists/"..chat_id.."stats.txt", "w") file:write(text) file:flush() file:close() send_document(receiver,"./groups/lists/"..chat_id.."stats.txt", ok_cb, false) return --text end local function chat_stats2(chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = 'Users in this chat \n' for k,user in pairs(users_info) do text = text..user.name..' = '..user.msgs..'\n' end return text end -- Save stats, ban user local function bot_stats() local redis_scan = [[ local cursor = '0' local count = 0 repeat local r = redis.call("SCAN", cursor, "MATCH", KEYS[1]) cursor = r[1] count = count + #r[2] until cursor == '0' return count]] -- Users local hash = 'msgs:*:'..our_id local r = redis:eval(redis_scan, 1, hash) local text = 'Users: '..r hash = 'chat:*:users' r = redis:eval(redis_scan, 1, hash) text = text..'\nGroups: '..r return text end local function run(msg, matches) if matches[1]:lower() == 'telediamond' then -- Put everything you like :) local about = _config.about_text local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] used /telediamond ") return about end if matches[1]:lower() == "statslist" then if not is_momod(msg) then return "For mods only !" end local chat_id = msg.to.id local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ") return chat_stats2(chat_id) end if matches[1]:lower() == "stats" then if not matches[2] then if not is_momod(msg) then return "For mods only !" end if msg.to.type == 'chat' or msg.to.type == 'channel' then local receiver = get_receiver(msg) local chat_id = msg.to.id local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ") return chat_stats(receiver, chat_id) else return end end if matches[2] == "telediamond" then -- Put everything you like :) if not is_admin1(msg) then return "For admins only !" else return bot_stats() end end if matches[2] == "group" then if not is_admin1(msg) then return "For admins only !" else return chat_stats(matches[3]) end end end end return { patterns = { "^[#!/]([Ss]tats)$", "^[#!/]([Ss]tatslist)$", "^[#!/]([Ss]tats) (group) (%d+)", "^[#!/]([Ss]tats) (telediamond)", "^[#!/]([Tt]elediamond)" }, run = run } end
agpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/npcs/rebel/rebelLieutenantGeneral.lua
1
4785
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. rebelLieutenantGeneral = Creature:new { objectName = "rebelLieutenantGeneral", -- Lua Object Name creatureType = "NPC", faction = "Rebel", gender = "", name = "Rebel Lieutenant General", objectCRC = 262265598, socialGroup = "Rebel", named = FALSE, level = 27, xp = 2822, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 9900, healthMin = 8100, strength = 0, constitution = 0, actionMax = 9900, actionMin = 8100, quickness = 0, stamina = 0, mindMax = 9900, mindMin = 8100, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 30, stun = -1, blast = 0, heat = 30, cold = -1, acid = -1, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "", -- File path to weapon -> object\xxx\xxx\xx weaponName = "", -- Name ex. 'a Vibrolance' weaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 0, weaponMaxDamage = 0, weaponAttackSpeed = 0, weaponDamageType = "", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = 0, -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "", "", "" } -- respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(rebelLieutenantGeneral, 262265598) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/tangible/component/food/objects.lua
1
10156
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_tangible_component_food_shared_container_barrel = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/edb_con_barrel_lg_s1.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:barrel", gameObjectType = 262144, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:barrel", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_container_barrel, 208291925) object_tangible_component_food_shared_container_cask = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_comp_drink_alcoholic.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:cask", gameObjectType = 262144, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:cask", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_container_cask, 225597999) object_tangible_component_food_shared_container_large_glass = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/edb_con_glass_s2_full.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:large_glass", gameObjectType = 262144, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:large_glass", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_container_large_glass, 1157356093) object_tangible_component_food_shared_container_small_glass = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/edb_con_glass_s1_full.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:small_glass", gameObjectType = 262144, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:small_glass", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_container_small_glass, 4135258442) object_tangible_component_food_shared_ingredient_ball_of_dough = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_comp_bakery_item.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:dough", gameObjectType = 8202, locationReservationRadius = 0, lookAtText = "@weapon_lookat:dough", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:dough", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_ingredient_ball_of_dough, 4273682590) object_tangible_component_food_shared_ingredient_carbosyrup = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_comp_food_flavoring.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@craft_food_ingredients_d:carbosyrup", gameObjectType = 8202, locationReservationRadius = 0, lookAtText = "@weapon_lookat:carbosyrup", noBuildRadius = 0, objectName = "@craft_food_ingredients_n:carbosyrup", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_component_food_shared_ingredient_carbosyrup, 3067661591)
lgpl-3.0
meysamx0/Crazy
plugins/banhammer.lua
1
17030
local function pre_process(msg) local data = load_data(_config.moderation.data) -- SERVICE MESSAGE if msg.action and msg.action.type then local action = msg.action.type -- Check if banned user joins chat by link if action == 'chat_add_user_link' then local user_id = msg.from.id print('Checking invited user '..user_id) local banned = is_banned(user_id, msg.to.id) if banned or is_gbanned(user_id) then -- Check it with redis print('User is banned!') local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] is banned and kicked ! ")-- Save to logs kick_user(user_id, msg.to.id) end end -- Check if banned user joins chat if action == 'chat_add_user' then local user_id = msg.action.user.id print('Checking invited user '..user_id) local banned = is_banned(user_id, msg.to.id) if banned and not is_momod2(msg.from.id, msg.to.id) or is_gbanned(user_id) and not is_admin2(msg.from.id) then -- Check it with redis print('User is banned!') local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] added a banned user >"..msg.action.user.id)-- Save to logs kick_user(user_id, msg.to.id) local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id redis:incr(banhash) local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id local banaddredis = redis:get(banhash) if banaddredis then if tonumber(banaddredis) >= 4 and not is_owner(msg) then kick_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 3 times end if tonumber(banaddredis) >= 8 and not is_owner(msg) then ban_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 7 times local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id redis:set(banhash, 0)-- Reset the Counter end end end if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['lock_bots'] then bots_protection = data[tostring(msg.to.id)]['settings']['lock_bots'] end end end if msg.action.user.username ~= nil then if string.sub(msg.action.user.username, -3) == 'bot' and not is_momod(msg) and bots_protection == "yes" then --- Will kick bots added by normal users local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] added a bot > @".. msg.action.user.username)-- Save to logs kick_user(msg.action.user.id, msg.to.id) end end end -- No further checks return msg end -- banned user is talking ! if msg.to.type == 'chat' or msg.to.type == 'channel' then local group = msg.to.id local texttext = 'groups' --if not data[tostring(texttext)][tostring(msg.to.id)] and not is_realm(msg) then -- Check if this group is one of my groups or not --chat_del_user('chat#id'..msg.to.id,'user#id'..our_id,ok_cb,false) --return --end local user_id = msg.from.id local chat_id = msg.to.id local banned = is_banned(user_id, chat_id) if banned or is_gbanned(user_id) then -- Check it with redis print('Banned user talking!') local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] banned user is talking !")-- Save to logs kick_user(user_id, chat_id) msg.text = '' end end return msg end local function kick_ban_res(extra, success, result) local chat_id = extra.chat_id local chat_type = extra.chat_type if chat_type == "chat" then receiver = 'chat#id'..chat_id else receiver = 'channel#id'..chat_id end if success == 0 then return send_large_msg(receiver, "⚠️خطاے 404\nنام ڪاربرے مورد نظر پیدا نشد.") end local member_id = result.peer_id local user_id = member_id local member = result.username local from_id = extra.from_id local get_cmd = extra.get_cmd if get_cmd == "kick" then if member_id == from_id then send_large_msg(receiver, "!!") return end if is_momod2(member_id, chat_id) and not is_admin2(sender) then send_large_msg(receiver, "❗️فقط ناظم ها 🔺 مدیر ها 🔺 ادمین ها مےتوانند اخراج ڪنند.") return end kick_user(member_id, chat_id) elseif get_cmd == 'ban' then if is_momod2(member_id, chat_id) and not is_admin2(sender) then send_large_msg(receiver, "!!") return end send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..user_id..' ] ━━━━━━━━━━━━━\n🛡ورود ڪاربر در گروه ممنوع شد.') ban_user(member_id, chat_id) elseif get_cmd == 'unban' then send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..user_id..' ] ━━━━━━━━━━━━━\n🛡ڪاربر از ممنوعیت در گروه خارج شد.') local hash = 'banned:'..chat_id redis:srem(hash, member_id) return 'Done\n User Unbanned' elseif get_cmd == 'banall' then send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..user_id..' ] ━━━━━━━━━━━━━\n🛡ورود ڪاربر در تمامے گروههاے ربات ممنوع شد.') banall_user(member_id) elseif get_cmd == 'unbanall' then send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..user_id..' ] ━━━━━━━━━━━━━\n🛡ڪاربر از ممنوعیت در تمامے گروههاے ربات خارج شد.') unbanall_user(member_id) end end local function run(msg, matches) local support_id = msg.from.id if matches[1]:lower() == 'id' and msg.to.type == "chat" or msg.to.type == "user" or matches[1] == 'ایدی' and msg.to.type == "chat" or msg.to.type == "user" then if msg.to.type == "user" then return reply_msg(msg.id, "🔰شناسه ربات:\n🆔 |"..msg.to.id.."|\n━━━━━━━━━━━━━\n🔰شناسه شما:\n🆔 |"..msg.from.id.."| ", ok_cb, false) end if type(msg.reply_id) ~= "nil" then local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") id = get_message(msg.reply_id,get_message_callback_id, false) elseif matches[1]:lower() == 'id' then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") return "<b> > Group ID: "..msg.to.id.."\n> Group Name: "..msg.to.title.."\n> First Name: "..(msg.from.first_name or '').."\n> Last Name: "..(msg.from.last_name or '').."\n> Your ID: "..msg.from.id.."\n> Username: @"..(msg.from.username or '').."\n> Phone Number: +"..(msg.from.phone or '').."\n> Group Type: #Normal</b>" end end if matches[1]:lower() == "banlist" or matches[1] == "ممنوع شده ها" then -- Ban list ! local chat_id = msg.to.id if matches[2] and is_admin1(msg) then chat_id = matches[2] end return ban_list(chat_id) end if matches[1]:lower() == 'ban' or matches[1] == 'ممنوع کاربر' then-- /ban if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin1(msg) then msgr = get_message(msg.reply_id,ban_by_reply_admins, false) else msgr = get_message(msg.reply_id,ban_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id elseif string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then return "you can't ban mods/owner/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't ban your self !" end local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") local receiver = get_receiver(msg) savelog(msg.to.id, name.." ["..msg.from.id.."] baned user ".. matches[2]) ban_user(matches[2], msg.to.id) send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..matches[2]..'] ━━━━━━━━━━━━━\n🛡ورود ڪاربر در گروه ممنوع شد.') else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'ban', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'unban' or matches[1] == 'خروج از ممنوعیت' then -- /unban if type(msg.reply_id)~="nil" and is_momod(msg) then local msgr = get_message(msg.reply_id,unban_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id local targetuser = matches[2] if string.match(targetuser, '^%d+$') then local user_id = targetuser local hash = 'banned:'..chat_id redis:srem(hash, user_id) local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] unbaned user ".. matches[2]) return '━━━━━━━━━━━━━\nUser : ['..user_id..' ] ━━━━━━━━━━━━━\n🛡ڪاربر از ممنوعیت در گروه خارج شد.' else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'unban', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'kick' or matches[1] == 'اخراج' then if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin1(msg) then msgr = get_message(msg.reply_id,Kick_by_reply_admins, false) else msgr = get_message(msg.reply_id,Kick_by_reply, false) end elseif string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then return "❗️فقط ناظم ها 🔺 مدیر ها 🔺 ادمین ها مےتوانند اخراج ڪنند." end if tonumber(matches[2]) == tonumber(msg.from.id) then return "❗️فقط ناظم ها 🔺 مدیر ها 🔺 ادمین ها مےتوانند اخراج ڪنند." end local user_id = matches[2] local chat_id = msg.to.id local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") savelog(msg.to.id, name.." ["..msg.from.id.."] kicked user ".. matches[2]) kick_user(user_id, chat_id) else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'kick', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if not is_admin1(msg) and not is_support(support_id) then return end if matches[1]:lower() == 'banall' then-- /ban if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin1(msg) then msgr = get_message(msg.reply_id,banall_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id elseif string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then return "you can't ban mods/owner/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't ban your self !" end local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") local receiver = get_receiver(msg) savelog(msg.to.id, name.." ["..msg.from.id.."] banedall user ".. matches[2]) banall_user(matches[2]) send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..matches[2]..' ] ━━━━━━━━━━━━━\n🛡ورود ڪاربر در تمامے گروههاے ربات ممنوع شد.') else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'banall', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'unbanall' then-- /ban if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin1(msg) then msgr = get_message(msg.reply_id,unbanall_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id elseif string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") local receiver = get_receiver(msg) savelog(msg.to.id, name.." ["..msg.from.id.."] unbanedall user ".. matches[2]) unbanall_user(matches[2]) send_large_msg(receiver, '━━━━━━━━━━━━━\nUser : ['..matches[2]..' ] ━━━━━━━━━━━━━\n🛡ڪاربر از ممنوعیت در تمامے گروههاے ربات خارج شد.') else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'unbanall', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'unban' or matches[1] == 'خروج از ممنوعیت' then-- /ban if type(msg.reply_id)~="nil" and is_momod(msg) then if is_momod(msg) then msgr = get_message(msg.reply_id,unban_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id elseif string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") local receiver = get_receiver(msg) savelog(msg.to.id, name.." ["..msg.from.id.."] unban user ".. matches[2]) local hash = 'banned:'..msg.to.id redis:srem(hash, matches[2]) send_large_msg(receiver, 'User ['..matches[2]..'] unbanned') else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'unban', from_id = msg.from.id, chat_type = msg.to.type } local username = string.gsub(matches[2], '@', '') resolve_username(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'del' then if not is_sudo(msg) then return end if matches[2]:lower() == 'gbanlist' then local hash = 'gbanned' send_large_msg(get_receiver(msg), "🔴 لیست سوپر بن پاڪ شد.") redis:del(hash) end end if matches[1]:lower() == "gbanlist" then -- Global ban list return banall_list() end end return { patterns = { "^[#!/]([Bb][Aa][Nn][Aa][Ll][Ll]) (.*)$", "^[#!/]([MBb][Aa][Nn][Aa][Ll][Ll])$", "^[#!/]([Bb][Aa][Nn][Ll][Ii][Ss][Tt]) (.*)$", "^[#!/]([Bb][Aa][Nn][Ll][Ii][Ss][Tt])$", "^[#!/]([Gg][Bb][Aa][Nn][Ll][Ii][Ss][Tt])$", "^[#!/]([Kk][Ii][Cc][Kk][Mm][Ee])", "^[#!/]([Kk][Ii][Cc][Kk])$", "^[#!/]([Bb][Aa][Nn])$", "^[#!/]([Bb][Aa][Nn]) (.*)$", "^[#!/]([Uu][Nn][Bb][Aa][Nn]) (.*)$", "^[#!/]([Uu][Nn][Bb][Aa][Nn][Aa][Ll][Ll]) (.*)$", "^[#!/]([Uu][n][Bb][Aa][Nn][Aa][Ll][Ll])$", "^[#!/]([Kk][Ii][Cc][Kk]) (.*)$", "^[#!/]([Uu][Nn][Bb][Aa][Nn])$", "^[#!/]([Ii][Dd])$", "^([Bb][Aa][Nn][Aa][Ll][Ll]) (.*)$", "^([MBb][Aa][Nn][Aa][Ll][Ll])$", "^([Bb][Aa][Nn][Ll][Ii][Ss][Tt]) (.*)$", "^([Bb][Aa][Nn][Ll][Ii][Ss][Tt])$", "^([Gg][Bb][Aa][Nn][Ll][Ii][Ss][Tt])$", "^([Kk][Ii][Cc][Kk][Mm][Ee])", "^([Kk][Ii][Cc][Kk])$", "^([Bb][Aa][Nn])$", "^([Bb][Aa][Nn]) (.*)$", "^([Uu][Nn][Bb][Aa][Nn]) (.*)$", "^([Uu][Nn][Bb][Aa][Nn][Aa][Ll][Ll]) (.*)$", "^[([Uu][n][Bb][Aa][Nn][Aa][Ll][Ll])$", "^([Kk][Ii][Cc][Kk]) (.*)$", "^([Uu][Nn][Bb][Aa][Nn])$", "^([Ii][Dd])$", "^(ایدی)$", "^(اخراج) (.*)$", "^(خروج از ممنوعیت) (.*)$", "^(ممنوع کاربر) (.*)$", "^(ممنوع شده ها)$", "^!!tgservice (.+)$" }, run = run, pre_process = pre_process }
agpl-3.0
shahabsaf1/test
plugins/qr.lua
637
1730
--[[ * qr plugin uses: * - http://goqr.me/api/doc/create-qr-code/ * psykomantis ]] local function get_hex(str) local colors = { red = "f00", blue = "00f", green = "0f0", yellow = "ff0", purple = "f0f", white = "fff", black = "000", gray = "ccc" } for color, value in pairs(colors) do if color == str then return value end end return str end local function qr(receiver, text, color, bgcolor) local url = "http://api.qrserver.com/v1/create-qr-code/?" .."size=600x600" --fixed size otherways it's low detailed .."&data="..URL.escape(text:trim()) if color then url = url.."&color="..get_hex(color) end if bgcolor then url = url.."&bgcolor="..get_hex(bgcolor) end local response, code, headers = http.request(url) if code ~= 200 then return "Oops! Error: " .. code end if #response > 0 then send_photo_from_url(receiver, url) return end return "Oops! Something strange happened :(" end local function run(msg, matches) local receiver = get_receiver(msg) local text = matches[1] local color local back if #matches > 1 then text = matches[3] color = matches[2] back = matches[1] end return qr(receiver, text, color, back) end return { description = {"qr code plugin for telegram, given a text it returns the qr code"}, usage = { "!qr [text]", '!qr "[background color]" "[data color]" [text]\n' .."Color through text: red|green|blue|purple|black|white|gray\n" .."Colors through hex notation: (\"a56729\" is brown)\n" .."Or colors through decimals: (\"255-192-203\" is pink)" }, patterns = { '^!qr "(%w+)" "(%w+)" (.+)$', "^!qr (.+)$" }, run = run }
gpl-2.0
TheAnswer/FirstTest
bin/scripts/items/objects/deed.lua
1
2147
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. Deed = Object:new { objectName = "", templateName = "", objectCRC = "", objectType = DEED }
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/armorsmith/personalArmorIChitin/chitinArmorBoots.lua
1
5205
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. chitinArmorBoots = Object:new { objectName = "Chitin Armor Boots", stfName = "armor_chitin_s01_boots", stfFile = "wearables_name", objectCRC = 1821888750, groupName = "craftArmorPersonalGroupB", -- Group schematic is awarded in (See skills table) craftingToolTab = 2, -- (See DraftSchemticImplementation.h) complexity = 25, size = 3, xpType = "crafting_clothing_armor", xp = 180, assemblySkill = "armor_assembly", experimentingSkill = "armor_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "auxilary_coverage, body, liner, hardware_and_attachments, binding_and_reinforcement, padding, armor, load_bearing_harness, reinforcement", ingredientSlotType = "0, 0, 0, 0, 0, 0, 2, 2, 2", resourceTypes = "bone, hide_leathery, hide_scaley, metal_ferrous, petrochem_inert_polymer, hide_wooly, object/tangible/component/armor/shared_armor_segment_chitin.iff, object/tangible/component/clothing/shared_fiberplast_panel.iff, object/tangible/component/clothing/shared_reinforced_fiber_panels.iff", resourceQuantities = "20, 20, 20, 10, 10, 10, 2, 1, 1", combineTypes = "0, 0, 0, 0, 0, 0, 1, 1, 1", contribution = "100, 100, 100, 100, 100, 100, 100, 100, 100", numberExperimentalProperties = "1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1", experimentalProperties = "XX, XX, XX, OQ, SR, OQ, SR, OQ, UT, MA, OQ, MA, OQ, MA, OQ, XX, XX, OQ, SR, XX", experimentalWeights = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalGroupTitles = "null, null, null, null, exp_quality, exp_durability, exp_durability, exp_durability, exp_durability, null, null, exp_resistance, null", experimentalSubGroupTitles = "null, null, sockets, hit_points, armor_effectiveness, armor_integrity, armor_health_encumbrance, armor_action_encumbrance, armor_mind_encumbrance, armor_rating, armor_special_type, armor_special_effectiveness, armor_special_integrity", experimentalMin = "0, 0, 0, 1000, 5, 15000, 13, 25, 16, 1, 1, 5, 15000", experimentalMax = "0, 0, 0, 1000, 30, 25000, 8, 15, 9, 1, 1, 40, 25000", experimentalPrecision = "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", tanoAttributes = "objecttype=263:objectcrc=1961496739:stfFile=wearables_name:stfName=armor_chitin_s01_boots:stfDetail=:itemmask=62967:customattributes=specialprotection=kineticeffectiveness;vunerability=stuneffectiveness,heateffectiveness,coldeffectiveness,restraineffectiveness;armorPiece=263;armorStyle=4102;:", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "/private/index_color_0, /private/index_color_1", customizationDefaults = "0, 6", customizationSkill = "armor_customization" } DraftSchematics:addDraftSchematic(chitinArmorBoots, 1821888750)--- Add to global DraftSchematics table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/items/objects/armor/composite/composite_bracer_l.lua
1
2428
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. composite_bracer_l = Armor:new{ objectName = "Composite Bracer", templateName = "armor_composite_bracer_l", objectCRC = 1303386413, objectType = ARMARMOR, armorType = ARMOR_BRACERL, energyResist = 35, kineticResist = 35, healthEncum = 70, actionEncum = 70, mindEncum = 70, itemMask = HUMANOIDS }
lgpl-3.0
thkhxm/TGame
Assets/StreamingAssets/lua/misc/utf8.lua
15
8353
local utf8 = {} --byte index of the next char after the char at byte index i, followed by a valid flag for the char at byte index i. --nil if not found. invalid characters are iterated as 1-byte chars. function utf8.next_raw(s, i) if not i then if #s == 0 then return nil end return 1, true --fake flag (doesn't matter since this flag is not to be taken as full validation) end if i > #s then return end local c = s:byte(i) if c >= 0x00 and c <= 0x7F then i = i + 1 elseif c >= 0xC2 and c <= 0xDF then i = i + 2 elseif c >= 0xE0 and c <= 0xEF then i = i + 3 elseif c >= 0xF0 and c <= 0xF4 then i = i + 4 else --invalid return i + 1, false end if i > #s then return end return i, true end --next() is the generic iterator and can be replaced for different semantics. next_raw() must preserve its semantics. utf8.next = utf8.next_raw --iterate chars, returning the byte index where each char starts function utf8.byte_indices(s, previ) return utf8.next, s, previ end --number of chars in string function utf8.len(s) assert(s, "bad argument #1 to 'len' (string expected, got nil)") local len = 0 for _ in utf8.byte_indices(s) do len = len + 1 end return len end --byte index given char index. nil if the index is outside the string. function utf8.byte_index(s, target_ci) if target_ci < 1 then return end local ci = 0 for i in utf8.byte_indices(s) do ci = ci + 1 if ci == target_ci then return i end end assert(target_ci > ci, "invalid index") end --char index given byte index. nil if the index is outside the string. function utf8.char_index(s, target_i) if target_i < 1 or target_i > #s then return end local ci = 0 for i in utf8.byte_indices(s) do ci = ci + 1 if i == target_i then return ci end end error("invalid index") end --byte index of the prev. char before the char at byte index i, which defaults to #s + 1. --nil if the index is outside the 2..#s+1 range. --NOTE: unlike next(), this is a O(N) operation! function utf8.prev(s, nexti) nexti = nexti or #s + 1 if nexti <= 1 or nexti > #s + 1 then return end local lasti, lastvalid = utf8.next(s) for i, valid in utf8.byte_indices(s) do if i == nexti then return lasti, lastvalid end lasti, lastvalid = i, valid end if nexti == #s + 1 then return lasti, lastvalid end error("invalid index") end --iterate chars in reverse order, returning the byte index where each char starts. function utf8.byte_indices_reverse(s, nexti) if #s < 200 then --using prev() is a O(N^2/2) operation, ok for small strings (200 chars need 40,000 iterations) return utf8.prev, s, nexti else --store byte indices in a table and iterate them in reverse. --this is 40x slower than byte_indices() but still fast at 2mil chars/second (but eats RAM and makes garbage). local t = {} for i in utf8.byte_indices(s) do if nexti and i >= nexti then break end table.insert(t, i) end local i = #t + 1 return function() i = i - 1 return t[i] end end end --sub based on char indices, which, unlike with standard string.sub(), can't be negative. --start_ci can be 1..inf and end_ci can be 0..inf. end_ci can be nil meaning last char. --if start_ci is out of range or end_ci < start_ci, the empty string is returned. --if end_ci is out of range, it is considered to be the last position in the string. function utf8.sub(s, start_ci, end_ci) --assert for positive indices because we might implement negative indices in the future. assert(start_ci >= 1) assert(not end_ci or end_ci >= 0) local ci = 0 local start_i, end_i for i in utf8.byte_indices(s) do ci = ci + 1 if ci == start_ci then start_i = i end if ci == end_ci then end_i = i end end if not start_i then assert(start_ci > ci, 'invalid index') return '' end if end_ci and not end_i then if end_ci < start_ci then return '' end assert(end_ci > ci, 'invalid index') end return s:sub(start_i, end_i and end_i - 1) end --check if a string contains a substring at byte index i without making garbage. --nil if the index is out of range. true if searching for the empty string. function utf8.contains(s, i, sub) if i < 1 or i > #s then return nil end for si = 1, #sub do if s:byte(i + si - 1) ~= sub:byte(si) then return false end end return true end --count the number of occurences of a substring in a string. the substring cannot be the empty string. function utf8.count(s, sub) assert(#sub > 0) local count = 0 local i = 1 while i do if utf8.contains(s, i, sub) then count = count + 1 i = i + #sub if i > #s then break end else i = utf8.next(s, i) end end return count end --utf8 validation and sanitization --check if there's a valid utf8 codepoint at byte index i. valid ranges for each utf8 byte are: -- byte 1 2 3 4 -------------------------------------------- -- 00 - 7F -- C2 - DF 80 - BF -- E0 A0 - BF 80 - BF -- E1 - EC 80 - BF 80 - BF -- ED 80 - 9F 80 - BF -- EE - EF 80 - BF 80 - BF -- F0 90 - BF 80 - BF 80 - BF -- F1 - F3 80 - BF 80 - BF 80 - BF -- F4 80 - 8F 80 - BF 80 - BF function utf8.isvalid(s, i) local c = s:byte(i) if not c then return false elseif c >= 0x00 and c <= 0x7F then return true elseif c >= 0xC2 and c <= 0xDF then local c2 = s:byte(i + 1) return c2 and c2 >= 0x80 and c2 <= 0xBF elseif c >= 0xE0 and c <= 0xEF then local c2 = s:byte(i + 1) local c3 = s:byte(i + 2) if c == 0xE0 then return c2 and c3 and c2 >= 0xA0 and c2 <= 0xBF and c3 >= 0x80 and c3 <= 0xBF elseif c >= 0xE1 and c <= 0xEC then return c2 and c3 and c2 >= 0x80 and c2 <= 0xBF and c3 >= 0x80 and c3 <= 0xBF elseif c == 0xED then return c2 and c3 and c2 >= 0x80 and c2 <= 0x9F and c3 >= 0x80 and c3 <= 0xBF elseif c >= 0xEE and c <= 0xEF then if c == 0xEF and c2 == 0xBF and (c3 == 0xBE or c3 == 0xBF) then return false --uFFFE and uFFFF non-characters end return c2 and c3 and c2 >= 0x80 and c2 <= 0xBF and c3 >= 0x80 and c3 <= 0xBF end elseif c >= 0xF0 and c <= 0xF4 then local c2 = s:byte(i + 1) local c3 = s:byte(i + 2) local c4 = s:byte(i + 3) if c == 0xF0 then return c2 and c3 and c4 and c2 >= 0x90 and c2 <= 0xBF and c3 >= 0x80 and c3 <= 0xBF and c4 >= 0x80 and c4 <= 0xBF elseif c >= 0xF1 and c <= 0xF3 then return c2 and c3 and c4 and c2 >= 0x80 and c2 <= 0xBF and c3 >= 0x80 and c3 <= 0xBF and c4 >= 0x80 and c4 <= 0xBF elseif c == 0xF4 then return c2 and c3 and c4 and c2 >= 0x80 and c2 <= 0x8F and c3 >= 0x80 and c3 <= 0xBF and c4 >= 0x80 and c4 <= 0xBF end end return false end --byte index of the next valid utf8 char after the char at byte index i. --nil if indices go out of range. invalid characters are skipped. function utf8.next_valid(s, i) local valid i, valid = utf8.next_raw(s, i) while i and (not valid or not utf8.isvalid(s, i)) do i, valid = utf8.next(s, i) end return i end --iterate valid chars, returning the byte index where each char starts function utf8.valid_byte_indices(s) return utf8.next_valid, s end --assert that a string only contains valid utf8 characters function utf8.validate(s) for i, valid in utf8.byte_indices(s) do if not valid or not utf8.isvalid(s, i) then error(string.format('invalid utf8 char at #%d', i)) end end end local function table_lookup(s, i, j, t) return t[s:sub(i, j)] end --replace characters in string based on a function f(s, i, j, ...) -> replacement_string | nil function utf8.replace(s, f, ...) if type(f) == 'table' then return utf8.replace(s, table_lookup, f) end if s == '' then return s end local t = {} local lasti = 1 for i in utf8.byte_indices(s) do local nexti = utf8.next(s, i) or #s + 1 local repl = f(s, i, nexti - 1, ...) if repl then table.insert(t, s:sub(lasti, i - 1)) table.insert(t, repl) lasti = nexti end end table.insert(t, s:sub(lasti)) return table.concat(t) end local function replace_invalid(s, i, j, repl_char) if not utf8.isvalid(s, i) then return repl_char end end --replace invalid utf8 chars with a replacement char function utf8.sanitize(s, repl_char) repl_char = repl_char or '�' --\uFFFD return utf8.replace(s, replace_invalid, repl_char) end return utf8
apache-2.0
TheAnswer/FirstTest
bin/scripts/object/universe/base/objects.lua
1
3920
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_universe_base_shared_base_universe = SharedUniverseObjectTemplate:new { appearanceFilename = "", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 0, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 0, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "string_id_table", gameObjectType = 2048, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "string_id_table", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 0, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_universe_base_shared_base_universe, 2428076790) object_universe_base_shared_universe_default = SharedUniverseObjectTemplate:new { appearanceFilename = "", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 0, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 0, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "string_id_table", gameObjectType = 2048, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "string_id_table", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 0, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 0, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_universe_base_shared_universe_default, 3854968513)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/creature/npc/general/objects.lua
1
3333
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_creature_npc_general_shared_skill_trainer = SharedCreatureObjectTemplate:new { appearanceFilename = "appearance/hum_m.sat", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 255, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "", gameObjectType = 1025, locationReservationRadius = 0, lookAtText = "@npc_lookat:skill_trainer", noBuildRadius = 0, objectName = "@npc_name:skill_trainer", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/player.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_creature_npc_general_shared_skill_trainer, 2389040637)
lgpl-3.0
B1GAPTEAM/B1GAPBOT
plugins/lock_chat.lua
13
2802
local function run(msg, matches) if msg.to.type == 'chat' then if is_momod(msg) then return end local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['lock_chat'] then lock_chat = data[tostring(msg.to.id)]['settings']['lock_chat'] end end end local chat = get_receiver(msg) local user = "user#id"..msg.from.id if lock_chat == "yes" then chat_del_user(chat, user, ok_cb, true) end end end return { patterns = { "(.*)", "%[(video)%]", "%[(document)%]", "%[(unsupported)%]", "%[(audio)%]", "%[(contact)%]", }, run = run } -- -_-_-_-_-_-_-_-_-_- ||-_-_-_-_-_ || ||-_-_-_-_-_ -- || || || || -- || || || || -- || || || || -- || ||-_-_-_-_-_ || ||-_-_-_-_-_ -- || || || || -- || || || || -- || || || || -- || ||-_-_-_-_-_ ||-_-_-_-_-_ ||-_-_-_-_-_ -- -- -- /\ /\ /-_-_-_-_-_ ||-_-_-_-_-_ ||-_-_-_-_-_ -- ||\\ //|| //\\ || //|| //\\ // || || // -- || \\ // || // \\ || // || // \\ // || || // -- || \\ // || // \\ || // || // \\ || || || // -- || \\ // || //______\\ || // || //______\\ || -_-_-_- ||-_-_-_-_-_ || // -- || \\ // || // \\ || // || // \\ || || || || \\ -- || \\ // || // \\ || // || // \\ \\ || || || \\ -- || \\// || // \\ ||// || // \\ \\-_-_-_-_-|| ||-_-_-_-_-_ || \\ -- -- -- ||-_-_-_- || || || //-_-_-_-_-_- -- || || || || || // -- ||_-_-_|| || || || // -- || || || || \\ -- || || \\ // \\ -- || || \\ // // -- || ||-_-_-_-_ \\-_-_-_-// -_-_-_-_-_-// -- --By @ali_ghoghnoos --@telemanager_ch
gpl-2.0
Lunovox/minetest_nibirus_game
mods/add/lunoshooters/api.lua
1
10975
lunoshooters = { time = 0, objects = {}, rounds = {}, shots = {}, } SHOOTER_EXPLOSION_TEXTURE = "shooter_hit.png" SHOOTER_ALLOW_NODES = false SHOOTER_ALLOW_ENTITIES = true SHOOTER_ALLOW_PLAYERS = true -- "unprotected" / true / false SHOOTER_OBJECT_RELOAD_TIME = 1 SHOOTER_OBJECT_UPDATE_TIME = 0.25 SHOOTER_ROUNDS_UPDATE_TIME = 0.4 SHOOTER_PLAYER_OFFSET = {x=0, y=1, z=0} SHOOTER_ENTITY_OFFSET = {x=0, y=0, z=0} SHOOTER_ENTITIES = { "lunomobs:areinite", "lunomobs:ghost1", "lunomobs:golem", "lunomobs:gossamer", "lunomobs:moose1", "lunomobs:oerkki", "lunomobs:rat", "lunomobs:ravitarbo", "lunomobs:sasquatch", --"lunomobs:sheep", "lunomobs:slimer", "lunomobs:spider1", "lunomobs:spider2", "lunomobs:terranite", "lunomobs:thief", "lunomobs:trader1", --"lunomobs:chicken", --"lunomobs:cow", } if minetest.is_singleplayer() == true then SHOOTER_ALLOW_ENTITIES = true SHOOTER_ALLOW_PLAYERS = false end local allowed_entities = {} for _,v in ipairs(SHOOTER_ENTITIES) do allowed_entities[v] = 1 end local modpath = minetest.get_modpath(minetest.get_current_modname()) local input = io.open(modpath.."/shooter.conf", "r") if input then dofile(modpath.."/shooter.conf") input:close() input = nil end local rounds_update_time = 0 local object_update_time = 0 local object_reload_time = 0 local function get_dot_product(v1, v2) return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z end local function spawn_particles(p, v, d, texture) if p and v and d then if type(texture) ~= "string" then texture = SHOOTER_EXPLOSION_TEXTURE end local pos = vector.add(p, vector.multiply(v, {x=d, y=d, z=d})) pos.y = pos.y + 0.75 local spread = {x=0.1, y=0.1, z=0.1} --[[ --FUNÇAO DEPRECADA PELA 0.4.10 minetest.add_particlespawner(15, 0.3, vector.subtract(pos, spread), vector.add(pos, spread), {x=-1, y=1, z=-1}, {x=1, y=2, z=1}, {x=-2, y=-2, z=-2}, {x=2, y=-2, z=2}, 0.1, 0.75, 1, 2, false, texture ) ]]-- minetest.add_particlespawner({ amount = 15, time = 0.3, minpos = vector.subtract(pos, spread), maxpos = vector.add(pos, spread), minvel = {x=-1, y=1, z=-1}, maxvel = {x=1, y=2, z=1}, minacc = {x=-2, y=-2, z=-2}, maxacc = {x=2, y=-2, z=2}, minexptime = 0.1, maxexptime = 0.75, minsize = 1, maxsize = 2, collisiondetection = false, vertical = false, texture = texture, --playername = "singleplayer" }) end end local function is_valid_object(object) if object then if object:is_player() == true then return true end if SHOOTER_ALLOW_ENTITIES == true then local luaentity = object:get_luaentity() if luaentity then if luaentity.name then if allowed_entities[luaentity.name] then return true end end end end end return false end local function punch_node(pos, def) local node = minetest.get_node(pos) if not node then return end local item = minetest.registered_items[node.name] if not item then return end if item.groups then for k, v in pairs(def.groups) do local level = item.groups[k] or 0 if level >= v then minetest.remove_node(pos) local sounds = item.sounds if item.sounds then local spec = item.sounds.dug if spec then spec.pos = pos minetest.sound_play(spec.name, spec) end end if item.tiles then return item.tiles[1] end break end end end end local function process_round(round) local target = {object=nil, distance=10000} local p1 = round.pos local v1 = round.ray for _,ref in ipairs(lunoshooters.objects) do local p2 = vector.add(ref.pos, ref.offset) if p1 and p2 and ref.name ~= round.name then local x = vector.distance(p1, p2) if x < round.def.step then local n = vector.multiply(v1, {x=-1, y=0, z=-1}) local v2 = vector.subtract(p1, p2) local r1 = get_dot_product(n, v2) local r2 = get_dot_product(n, v1) if r2 ~= 0 then local t = -(r1 / r2) local td = vector.multiply(v1, {x=t, y=t, z=t}) local pt = vector.add(p1, td) local pd = vector.subtract(pt, p2) if math.abs(pd.x) < ref.collisionbox[4] and math.abs(pd.y) < ref.collisionbox[5] and math.abs(pd.z) < ref.collisionbox[6] then target.object = ref.object target.pos = pt target.distance = x end end end end end if target.object and target.pos then local success, pos = minetest.line_of_sight(p1, target.pos, 1) if success then local user = minetest.get_player_by_name(round.name) --[[ print("-----------------------------------------------------------------------") print("target.pos="..minetest.pos_to_string(target.pos)..", round.name="..round.name) print("can_interact("..round.name..")="..tostring(landrush.can_interact(target.pos, round.name))) if (SHOOTER_ALLOW_PLAYERS == true or (SHOOTER_ALLOW_PLAYERS=="unprotected" and landrush~=nil and landrush.can_interact(target.pos, round.name))) then print("AAAAAAAAAAAAAAAAAAAAAAAAAA") end ]]-- if user and (SHOOTER_ALLOW_PLAYERS == true or (SHOOTER_ALLOW_PLAYERS=="unprotected" and landrush~=nil and landrush.can_interact(target.pos, round.name))) --[[ ]]-- then target.object:punch(user, nil, round.def.tool_caps, v1) spawn_particles({x=p1.x, y=p1.y - 1, z=p1.z}, v1, target.distance, SHOOTER_EXPLOSION_TEXTURE) end return 1 elseif pos and SHOOTER_ALLOW_NODES == true then local texture = punch_node(pos, round.def) if texture then spawn_particles({x=p1.x, y=p1.y - 1, z=p1.z}, v1, vector.distance(p1, pos), texture) end return 1 end elseif SHOOTER_ALLOW_NODES == true then local d = round.def.step local p2 = vector.add(p1, vector.multiply(v1, {x=d, y=d, z=d})) local success, pos = minetest.line_of_sight(p1, p2, 1) if pos then local texture = punch_node(pos, round.def) if texture then spawn_particles({x=p1.x, y=p1.y - 1, z=p1.z}, v1, vector.distance(p1, pos), texture) end return 1 end end end function lunoshooters:fire_weapon(user, pointed_thing, def) if lunoshooters.shots[def.name] then if lunoshooters.time < lunoshooters.shots[def.name] then return end end lunoshooters.shots[def.name] = lunoshooters.time + def.tool_caps.full_punch_interval minetest.sound_play(def.sound, {object=user}) local v1 = user:get_look_dir() local p1 = user:getpos() if not v1 or not p1 then return end --[[ --FUNÇAO DEPRECADA PELA 0.4.10 minetest.add_particle({x=p1.x, y=p1.y + 1.6, z=p1.z}, vector.multiply(v1, {x=30, y=30, z=30}), {x=0, y=0, z=0}, 0.5, 0.25, false, def.particle ) ]]-- minetest.add_particle({ pos = {x=p1.x, y=p1.y + 1.6, z=p1.z}, vel = vector.multiply(v1, {x=30, y=30, z=30}), acc = {x=0, y=0, z=0}, expirationtime = 0.5, size = 0.25, collisiondetection = false, vertical = false, texture = def.particle, --playername = "singleplayer" }) if pointed_thing.type == "node" and SHOOTER_ALLOW_NODES == true then local pos = minetest.get_pointed_thing_position(pointed_thing, false) local texture = punch_node(pos, def) if texture then spawn_particles({x=p1.x, y=p1.y + 0.75, z=p1.z}, v1, vector.distance(p1, pos), texture) end elseif pointed_thing.type == "object" then local object = pointed_thing.ref if is_valid_object(object) == true then object:punch(user, nil, def.tool_caps, v1) local p2 = object:getpos() spawn_particles({x=p1.x, y=p1.y + 0.75, z=p1.z}, v1, vector.distance(p1, p2), SHOOTER_EXPLOSION_TEXTURE) end else lunoshooters:update_objects() table.insert(lunoshooters.rounds, { name = def.name, pos = vector.add(p1, {x=0, y=1.75, z=0}), ray = v1, dist = 0, def = def, }) end end function lunoshooters:load_objects() local objects = {} if SHOOTER_ALLOW_PLAYERS == true or SHOOTER_ALLOW_PLAYERS=="unprotected" then --SHOOTER_ALLOW_PLAYERS=="unprotected" and landrush.get_owner(pos) local players = minetest.get_connected_players() for _,player in ipairs(players) do local pos = player:getpos() local name = player:get_player_name() local hp = player:get_hp() or 0 --[[ print("-----------------------------------------------------------------------") print("pos="..minetest.pos_to_string(pos)..", name="..name) print("can_interact("..name..")="..tostring(landrush.can_interact(pos, name))) if landrush.get_owner(pos) then print("landrush.get_owner="..tostring(landrush.get_owner(pos))) else print("landrush.get_owner=nil") end ]]-- if pos and name and hp > 0 and (SHOOTER_ALLOW_PLAYERS == true or (SHOOTER_ALLOW_PLAYERS=="unprotected" and landrush~=nil and landrush.can_interact(pos, name))) then table.insert(objects, { name = name, object = player, pos = pos, collisionbox = {-0.25,-1.0,-0.25, 0.25, 0.8, 0.25}, offset = SHOOTER_PLAYER_OFFSET, }) end end end if SHOOTER_ALLOW_ENTITIES == true then for _,ref in pairs(minetest.luaentities) do if ref.object and ref.name then if allowed_entities[ref.name] then local pos = ref.object:getpos() local hp = ref.object:get_hp() or 0 if pos and hp > 0 then local def = minetest.registered_entities[ref.name] table.insert(objects, { name = ref.name, object = ref.object, pos = pos, collisionbox = def.collisionbox, offset = SHOOTER_ENTITY_OFFSET, }) end end end end end object_reload_time = lunoshooters.time object_update_time = lunoshooters.time lunoshooters.objects = {} for _,v in ipairs(objects) do table.insert(lunoshooters.objects, v) end end function lunoshooters:update_objects() if lunoshooters.time - object_reload_time > SHOOTER_OBJECT_RELOAD_TIME then lunoshooters:load_objects() elseif lunoshooters.time - object_update_time > SHOOTER_OBJECT_UPDATE_TIME then for i, ref in ipairs(lunoshooters.objects) do if ref.object then local pos = ref.object:getpos() if pos then lunoshooters.objects[i].pos = pos end else table.remove(lunoshooters.objects, i) end end object_update_time = lunoshooters.time end end minetest.register_on_joinplayer(function(player) player:hud_set_flags({crosshair = true}) end) minetest.register_globalstep(function(dtime) lunoshooters.time = lunoshooters.time + dtime if lunoshooters.time - rounds_update_time > SHOOTER_ROUNDS_UPDATE_TIME then for i, round in ipairs(lunoshooters.rounds) do if process_round(round) or round.dist > round.def.range then table.remove(lunoshooters.rounds, i) else local v = vector.multiply(round.ray, round.def.step) lunoshooters.rounds[i].pos = vector.add(round.pos, v) lunoshooters.rounds[i].dist = round.dist + round.def.step end end rounds_update_time = lunoshooters.time end if lunoshooters.time > 100000 then lunoshooters.shots = {} rounds_update_time = 0 object_reload_time = 0 object_update_time = 0 lunoshooters.time = 0 end end)
agpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/corellia/npcs/selonian/selonianScout.lua
1
4511
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. selonianScout = Creature:new { objectName = "selonianScout", -- Lua Object Name creatureType = "NPC", gender = "", speciesName = "selonian_scout", stfName = "mob/creature_names", objectCRC = 3612945735, socialGroup = "Selonian", level = 5, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 165, healthMin = 135, strength = 0, constitution = 0, actionMax = 165, actionMin = 135, quickness = 0, stamina = 0, mindMax = 165, mindMin = 135, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 0, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 45, weaponMaxDamage = 50, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateweaponAttackSpeed = 2, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateweaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "selonianAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(selonianScout, 3612945735) -- Add to Global Table
lgpl-3.0
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/entities/prop_ammo_drop/init.lua
1
4455
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") --Duby: I need to heavily clean up this file! But I simply don't have the time at the moment.. It works for now.. include("shared.lua") local function RefreshCrateOwners(pl) for _, ent in pairs(ents.FindByClass("prop_ammo_drop")) do if ent:IsValid() and ent:GetObjectOwner() == pl then ent:SetObjectOwner(NULL) end end end hook.Add("PlayerDisconnected", "ResupplyBox.PlayerDisconnected", RefreshCrateOwners) hook.Add("OnPlayerChangedTeam", "ResupplyBox.OnPlayerChangedTeam", RefreshCrateOwners) function ENT:Initialize() self:SetModel("models/items/boxmrounds.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetUseType(SIMPLE_USE) self:SetPlaybackRate(1) self:EmitSound("items/ammo_pickup.wav") local phys = self:GetPhysicsObject() if phys:IsValid() then phys:EnableMotion(true) end self:SetMaxObjectHealth(200) self:SetObjectHealth(self:GetMaxObjectHealth()) end function ENT:KeyValue(key, value) key = string.lower(key) if key == "maxcratehealth" then value = tonumber(value) if not value then return end self:SetMaxObjectHealth(value) elseif key == "cratehealth" then value = tonumber(value) if not value then return end self:SetObjectHealth(value) end end function ENT:AcceptInput(name, activator, caller, args) if name == "setcratehealth" then self:KeyValue("cratehealth", args) return true elseif name == "setmaxcratehealth" then self:KeyValue("maxcratehealth", args) return true end end function ENT:SetObjectHealth(health) self:SetDTFloat(0, health) if health <= 0 and not self.Destroyed then self.Destroyed = true local ent = ents.Create("prop_physics") if ent:IsValid() then ent:SetModel(self:GetModel()) ent:SetMaterial(self:GetMaterial()) ent:SetAngles(self:GetAngles()) ent:SetPos(self:GetPos()) ent:SetSkin(self:GetSkin() or 0) ent:SetColor(self:GetColor()) ent:Spawn() ent:Fire("break", "", 0) ent:Fire("kill", "", 0.1) ent:EnableMotion(true) end end end function ENT:OnTakeDamage(dmginfo) self:TakePhysicsDamage(dmginfo) local attacker = dmginfo:GetAttacker() if not (attacker:IsValid() and attacker:IsPlayer() and attacker:Team() == TEAM_HUMAN) then self:SetObjectHealth(self:GetObjectHealth() - dmginfo:GetDamage()) self:ResetLastBarricadeAttacker(attacker, dmginfo) end end function ENT:AltUse(activator, tr) --self:PackUp(activator) return end function ENT:OnPackedUp(pl) --pl:GiveEmptyWeapon("prop_ammo_drop") --pl:GiveAmmo(1, "helicoptergun") --pl:PushPackedItem(self:GetClass(), self:GetObjectHealth()) --self:Remove() return end function ENT:Think() if self.Destroyed then self:Remove() elseif self.Close and CurTime() >= self.Close then self.Close = nil self:ResetSequence("open") end end local NextUse = {} function ENT:Use(activator, caller) if not self:GetObjectOwner():IsValid() then self:SetObjectOwner(activator) end local owner = self:GetObjectOwner() local owneruid = owner:IsValid() and owner:UniqueID() or "nobody" local myuid = activator:UniqueID() local ammotype local ammotype2 local ammotype3 local ammotype4 local ammotype5 local ammotype6 local ammotype7 local wep = activator:GetActiveWeapon() if not wep:IsValid() then ammotype = "smg1" ammotype2 = "ar2" ammotype3 = "alyxgun" ammotype4 = "pistol" ammotype5 = "357" ammotype6 = "xbowbolt" ammotype7 = "buckshot" end if not ammotype then ammotype = wep:GetPrimaryAmmoTypeString() if not GAMEMODE.AmmoResupply[ammotype] then ammotype = "smg1" ammotype2 = "ar2" ammotype3 = "alyxgun" ammotype4 = "pistol" ammotype5 = "357" ammotype6 = "xbowbolt" ammotype7 = "buckshot" end end NextUse[myuid] = CurTime() + 120 net.Start("zs_nextresupplyuse") net.WriteFloat(NextUse[myuid]) net.Send(activator) activator:GiveAmmo(GAMEMODE.AmmoResupply[ammotype], ammotype) if activator ~= owner and owner:IsValid() and owner:IsPlayer() and owner:Team() == TEAM_HUMAN then owner.ResupplyBoxUsedByOthers = owner.ResupplyBoxUsedByOthers + 1 if owner.ResupplyBoxUsedByOthers % 2 == 0 then owner:AddPoints(1) end net.Start("zs_commission") net.WriteEntity(self) net.WriteEntity(activator) net.WriteUInt(1, 16) net.Send(owner) end if not self.Close then self:ResetSequence("close") self:EmitSound("mrgreen/supplycrates/mobile_use.mp3") end timer.Simple(0.05, function() self:Remove() end) end
gpl-2.0
thehyve/quisper-configuration-public
qsp/3scale.lua
1
5911
-- -- Created by IntelliJ IDEA. -- User: robert -- Date: 7/10/14 -- Time: 2:26 PM -- To change this template use File | Settings | File Templates. -- -- -- This module contains the methods needed to handle -- authentication and logging using 3scale -- local threescale = {} -- -- Builds a URL query string from a given table -- where each key is surrounded by "usage[...]" -- This method is used to send usage details to -- the 3scale backend -- -- For example: -- Input: { hits: 3 } -- Output: usage[hits]=3 -- function threescale.build_usage_querystring(query) local qstr = "" for i,v in pairs(query) do qstr = qstr .. 'usage[' .. i .. ']' .. '=' .. v .. '&' end return string.sub(qstr, 0, #qstr-1) end -- -- Extracts the usage information to be sent to -- the 3scale backend from the request. -- First return value is a query string to be used for sending data to 3scale -- Second return value is a list of rules matched. This is only used for debugging purposes -- function threescale.extract_usage(service, request) local usage, matched_rules = service.extract_usage(request) local found = next(usage) ~= nil -- if there was no match, usage is set to nil and it will respond a 404, this behavior can be changed if found then return threescale.build_usage_querystring(usage), table.concat(matched_rules, ", ") else return nil end end function threescale.get_debug_value() local h = ngx.req.get_headers() if h["X-3scale-debug"] == '<YOUR_PROVIDER_KEY>' then return true else return false end end --[[ Authorization logic ]]-- threescale.authorization = {} -- -- Extracts the authorization parameters from the -- header, url or body, depending on the setting -- function threescale.authorization.get_auth_params(where, method) local params = {} if where == "headers" then params = ngx.req.get_headers() elseif method == "GET" then params = ngx.req.get_uri_args() else ngx.req.read_body() params = ngx.req.get_post_args() end return qsp_utils.first_values(params) end threescale.authorization.check_credentials = {} function threescale.authorization.check_credentials.app_id_app_key(params, service) if params["app_id"] == nil or params["app_key"] == nil then threescale.error.no_credentials(service) end end function threescale.authorization.check_credentials.access_token(params, service) if params["access_token"] == nil then -- TODO: check where the params come threescale.error.no_credentials(service) end end function threescale.authorization.check_credentials.user_key(params, service) if params["user_key"] == nil then threescale.error.no_credentials(service) end end function threescale.authorization.authorize(auth_strat, params, service) if auth_strat == 'oauth' then threescale.authorization.oauth(params, service) else threescale.authorization.authrep(params, service) end end function threescale.authorization.oauth(params, service) local res = ngx.location.capture("/_threescale/toauth_authorize?access_token=".. params.access_token .. "&user_id=".. params.access_token, { share_all_vars = true }) if ngx.var.usage ~= nil then ngx.var.usage = threescale.authorization.add_trans(ngx.var.usage) end if res.status == 200 then local res2 = ngx.location.capture("/_threescale/oauth_report?access_token=".. params.access_token, {method = ngx.HTTP_POST, share_all_vars = true}) if res2.status ~= 202 then ngx.header.content_type = "application/json; charset=utf-8" ngx.print('{"error": "not authenticated in 3scale end"}') ngx.exit(ngx.HTTP_OK) end else ngx.print('{"error": "not authenticated in 3scale authorize returned'.. res.status .. ' "}') ngx.exit(ngx.HTTP_OK) end end function threescale.authorization.authrep(params, service) ngx.var.cached_key = ngx.var.cached_key .. ":" .. ngx.var.usage local api_keys = ngx.shared.api_keys local is_known = api_keys:get(ngx.var.cached_key) if is_known ~= 200 then local res = ngx.location.capture("/threescale_authrep", { share_all_vars = true }) -- IN HERE YOU DEFINE THE ERROR IF CREDENTIALS ARE PASSED, BUT THEY ARE NOT VALID if res.status ~= 200 then -- remove the key, if it's not 200 let's go the slow route, to 3scale's backend api_keys:delete(ngx.var.cached_key) ngx.status = res.status ngx.header.content_type = "application/json" threescale.error.authorization_failed(service) else api_keys:set(ngx.var.cached_key,200) end ngx.var.cached_key = nil end end function threescale.authorization.add_trans(usage) local us = usage:split("&") local ret = "" for i,v in ipairs(us) do ret = ret .. "transactions[0][usage]" .. string.sub(v, 6) .. "&" end return string.sub(ret, 1, -2) end -- -- Error Codes -- threescale.error = {} function threescale.error.raise(error) ngx.status = error.status ngx.header.content_type = error.headers ngx.print(error.text) ngx.exit(ngx.HTTP_OK) end function threescale.error.no_credentials(service) threescale.error.raise(service.error.no_credentials) end function threescale.error.authorization_failed(service) threescale.error.raise(service.error.auth_failed) end function threescale.error.no_match(service) threescale.error.raise(service.error.no_match) end function threescale.error.no_service() threescale.error.raise({ status = 404, text = 'No service found', headers = 'text/plain; charset=us-ascii' }) end -- End Error Codes return threescale
agpl-3.0
PAPAGENO-devels/papageno
test/benchmarks/Lua/700k.lua
1
712684
CheckFirstTime("tu.lua") dofile("ma_operate_bolt.lua") dofile("brennis_fix_idle.lua") dofile("brennis_on_fire.lua") dofile("tu_fans.lua") dofile("tu_switcher_door.lua") dofile("tu_deadbolt.lua") dofile("tu_switcher.lua") dofile("tu_canister.lua") dofile("tu_fire.lua") dofile("ma_tube_action.lua") tu = Set:create("tu.set", "Tube Room", { tu_dorcu = 0, tu_dorcu2 = 0, tu_redcu = 1, tu_swiha = 2, tu_swiha2 = 2, tu_swiha3 = 2, tu_tubws = 3, tu_tubws2 = 3, tu_swicu = 4, overhead = 5, tu_swopn = 6 }) tu.shrinkable = 0.029 tu.chem_state = "no chem" tu.door_state = "closed" tu.fan_volume = 30 tu.switcher_volume = 40 tu.set_up_switcher_door = function(arg1) -- line 32 local local1 local1 = tu.switcher_door.hObjectState tu.switcher_door.interest_actor:put_in_set(tu) tu.switcher_door:complete_chore(tu_switcher_door_gone, "tu_switcher_door.cos") ForceRefresh() if tu.door_state == "open" then tu.switcher_door.hObjectState = tu:add_object_state(tu_dorcu, "TU_0_DORCU_door_open.bm", "tu_dor_door_open.zbm", OBJSTATE_STATE) tu.switcher_door:complete_chore(tu_switcher_door_open, "tu_switcher_door.cos") elseif tu.door_state == "closed" then tu.switcher_door.hObjectState = tu:add_object_state(tu_dorcu, "TU_0_DORCU_door_close.bm", "tu_dor_door_close.zbm", OBJSTATE_STATE) tu.switcher_door:complete_chore(tu_switcher_door_closed, "tu_switcher_door.cos") else tu.switcher_door.hObjectState = tu:add_object_state(tu_dorcu, "TU_0_DORCU_door_ajar.bm", "TU_0_DORCU_door_ajar.zbm", OBJSTATE_STATE) tu.switcher_door:complete_chore(tu_switcher_door_ajar, "tu_switcher_door.cos") end SendObjectToBack(tu.switcher_door.hObjectState) if local1 then FreeObjectState(local1) end SendObjectToFront(tu.open_bolt.hObjectState) end tu.set_up_actors = function(arg1) -- line 57 if tu.chem_state == "both chem" then brennis:default() brennis:put_in_set(tu) brennis:setpos(0.27442, -0.4735, 0) brennis:setrot(0, 31.834, 0) brennis:set_mumble_chore(brennis_fix_idle_mumble) brennis:set_talk_chore(1, brennis_fix_idle_stop_talk) brennis:set_talk_chore(2, brennis_fix_idle_a) brennis:set_talk_chore(3, brennis_fix_idle_c) brennis:set_talk_chore(4, brennis_fix_idle_e) brennis:set_talk_chore(5, brennis_fix_idle_f) brennis:set_talk_chore(6, brennis_fix_idle_l) brennis:set_talk_chore(7, brennis_fix_idle_m) brennis:set_talk_chore(8, brennis_fix_idle_o) brennis:set_talk_chore(9, brennis_fix_idle_t) brennis:set_talk_chore(10, brennis_fix_idle_u) single_start_script(brennis.idle, brennis) if not brennis.burnt then preload_sfx("brSpark.WAV") preload_sfx("brExplo.WAV") preload_sfx("brFire.IMU") end else brennis:put_in_set(nil) end tu.extinguisher:set_object_state("extinguisher.cos") if tu.extinguisher.touchable then tu.extinguisher.interest_actor:play_chore(0) else tu.extinguisher.interest_actor:play_chore(1) end end tu.set_up_states = function(arg1) -- line 96 if tu.chem_state == "both chem" then MakeSectorActive("switcher_box1", FALSE) MakeSectorActive("switcher_box2", FALSE) MakeSectorActive("switcher_box3", FALSE) tu.door_wheel:make_untouchable() tu.closed_bolt:make_untouchable() tu.open_bolt:make_touchable() tu.open_wheel:make_touchable() tu.brennis_obj:make_touchable() tu.door_state = "open" else tu.brennis_obj:make_untouchable() if tu.door_state == "open" then MakeSectorActive("switcher_box1", TRUE) MakeSectorActive("switcher_box2", TRUE) MakeSectorActive("switcher_box3", TRUE) tu.door_wheel:make_untouchable() tu.closed_bolt:make_untouchable() tu.open_bolt:make_touchable() tu.open_wheel:make_touchable() else MakeSectorActive("switcher_box1", NIL) MakeSectorActive("switcher_box2", NIL) MakeSectorActive("switcher_box3", NIL) tu.door_wheel:make_touchable() tu.closed_bolt:make_touchable() tu.open_bolt:make_untouchable() tu.open_wheel:make_untouchable() end end tu.fans:make_untouchable() tu.fans.interest_actor:stop_chore() if tu.chem_state == "both chem" then tu.fans.interest_actor:play_chore(tu_fans_static, "tu_fans.cos") else if tu.door_state == "open" then tu.fans.interest_actor:play_chore_looping(tu_fans_spin_door_open, "tu_fans.cos") else tu.fans.interest_actor:play_chore_looping(tu_fans_spin, "tu_fans.cos") end single_start_sfx("tuFanLp.IMU", nil, tu.fan_volume) end tu.switcher.interest_actor:stop_chore() if tu.chem_state == "both chem" then stop_sound("tuSwtch.IMU") if tu.door_state == "open" then tu.switcher.interest_actor:play_chore(tu_switcher_still_door_open, "tu_switcher.cos") else tu.switcher.interest_actor:play_chore(tu_switcher_still, "tu_switcher.cos") end else if tu.door_state == "open" then tu.switcher.interest_actor:play_chore_looping(tu_switcher_switch_door_open, "tu_switcher.cos") else tu.switcher.interest_actor:play_chore_looping(tu_switcher_switch, "tu_switcher.cos") end single_start_sfx("tuSwtch.IMU", nil, tu.switcher_volume) end tu.switcher_door:set_object_state("tu_switcher_door.cos") tu.switcher_door.hObjectState = nil tu:set_up_switcher_door() if tu.door_state == "open" then MakeSectorActive("open_box_1", TRUE) MakeSectorActive("open_box_2", TRUE) MakeSectorActive("open_box_23", TRUE) MakeSectorActive("open_box_3", TRUE) MakeSectorActive("open_box_4", TRUE) MakeSectorActive("closed_box_11", FALSE) MakeSectorActive("closed_box_112", FALSE) MakeSectorActive("closed_box_1", FALSE) MakeSectorActive("closed_box_2", FALSE) MakeSectorActive("closed_box_3", FALSE) else MakeSectorActive("open_box_1", FALSE) MakeSectorActive("open_box_2", FALSE) MakeSectorActive("open_box_3", FALSE) MakeSectorActive("open_box_4", FALSE) MakeSectorActive("closed_box_1", TRUE) MakeSectorActive("closed_box_2", TRUE) MakeSectorActive("closed_box_3", TRUE) end if tu.door_state == "open" then if tu.open_bolt:is_locked() then tu.open_bolt:play_chore(tu_deadbolt_here) else tu.open_bolt:play_chore(tu_deadbolt_here_unlocked) end end end tu.set_up_object_states = function(arg1) -- line 202 tu:add_object_state(tu_dorcu, "tu_door_fan1.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_dorcu, "tu_door_fan2.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_tubws, "tu_fan_test.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_tubws, "tu_floor_fans1.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_tubws, "tu_floor_fans2.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_swopn, "tu_swi_fans.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_swopn, "tu_swi_fans2.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_swiha, "tu_swi_fans.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_swiha, "tu_swi_fans2.bm", nil, OBJSTATE_UNDERLAY) tu.fans:set_object_state("tu_fans.cos") tu:add_object_state(tu_tubws, "tu_tub_switcher.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_dorcu, "tu_dor_switcher.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_dorcu, "tu_dor_switcher_dopen.bm", nil, OBJSTATE_UNDERLAY) tu.switcher:set_object_state("tu_switcher.cos") tu.open_bolt.hObjectState = tu:add_object_state(tu_dorcu, "tu_turn_bolt.bm", "tu_turn_bolt.zbm", OBJSTATE_STATE) tu.open_bolt:set_object_state("tu_deadbolt.cos") tu:add_object_state(tu_tubws, "tu_3_bolt.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_redcu, "tu_can_go.bm", nil, OBJSTATE_UNDERLAY) tu:add_object_state(tu_redcu, "tu_can_stop.bm", nil, OBJSTATE_UNDERLAY) tu.red_tube:set_object_state("tu_canister.cos") tu:add_object_state(tu_tubws, "TU_3_TUBWS_doropn.bm", nil, OBJSTATE_UNDERLAY) if not brennis.burnt then LoadCostume("brennis_on_fire.cos") end end tu.send_balloon = function(arg1, arg2) -- line 240 local local1 = arg2.chem START_CUT_SCENE() ExpireText() arg2.source_balloon.owner = clown arg2:free() arg2.owner = pk cur_puzzle_state[4] = TRUE tu.closed_bolt:unlock() tu.open_bolt:unlock() brennis.seen_working_this_time = FALSE eva.talked_server = FALSE set_override(tu.skip_send_balloon, tu) ImSetState(STATE_NULL) break_here() if not tu.sent_balloon then tu.sent_balloon = TRUE end stop_sound("tuSwtch.IMU") if tu.chem_state == "no chem" then if local1 == 1 then tu.chem_state = "chem 1" RunFullscreenMovie("swtchuns.snm") else tu.chem_state = "chem 2" RunFullscreenMovie("swtchuns.snm") end elseif tu.chem_state == "chem 1" then if local1 == 1 then RunFullscreenMovie("swtchuns.snm") else tu.chem_state = "both chem" RunFullscreenMovie("swtchsuc.snm") end elseif tu.chem_state == "chem 2" then if local1 == 1 then tu.chem_state = "both chem" RunFullscreenMovie("swtchsuc.snm") else RunFullscreenMovie("swtchuns.snm") end elseif tu.chem_state == "both chem" then end wait_for_message() sleep_for(500) stop_sound("tuSwtch.IMU") ImSetState(stateMO) if tu.chem_state == "both chem" then start_sfx("tusqueal.IMU") sleep_for(1500) if not tu.ever_jammed then tu.ever_jammed = TRUE manny:say_line("/tuma048/") else manny:say_line("/tuma049/") end manny:wait_for_message() fade_sfx("tusqueal.IMU", 1500) end END_CUT_SCENE() end tu.skip_send_balloon = function(arg1) -- line 322 kill_override() stop_sound("tusqueal.IMU") tu.ever_jammed = TRUE end tu.send_bread = function(arg1, arg2) -- line 329 START_CUT_SCENE() ExpireText() tu.closed_bolt:unlock() tu.open_bolt:unlock() brennis.seen_working_this_time = FALSE eva.talked_server = FALSE ImSetState(STATE_NULL) break_here() stop_sound("tuSwtch.IMU") RunFullscreenMovie("swtchbrd.snm") wait_for_message() sleep_for(500) stop_sound("tuSwtch.IMU") ImSetState(stateMO) END_CUT_SCENE() end tu.send_canister_through = function(arg1) -- line 360 sleep_for(rndint(150, 1000)) start_sfx("tubCnPas.WAV") sleep_for(100) tu.red_tube:play_chore(tu_canister_pass_through) end brennis.burn = function(arg1, arg2) -- line 367 local local1, local2, local3 brennis.burnt = TRUE START_CUT_SCENE() cameraman_disabled = TRUE stop_script(brennis.idle) stop_script(brennis.stop_idle) if not arg2 then tu:add_object_state(tu_swopn, "tu_sparks.bm", nil, OBJSTATE_OVERLAY, TRUE) tu.flames:set_object_state("tu_fire.cos") tu:current_setup(tu_swopn) brennis:set_costume("brennis_on_fire.cos") brennis:set_mumble_chore(brennis_on_fire_mumble) brennis:set_talk_chore(1, brennis_on_fire_stop_talk) brennis:set_talk_chore(2, brennis_on_fire_a) brennis:set_talk_chore(3, brennis_on_fire_c) brennis:set_talk_chore(4, brennis_on_fire_e) brennis:set_talk_chore(5, brennis_on_fire_f) brennis:set_talk_chore(6, brennis_on_fire_l) brennis:set_talk_chore(7, brennis_on_fire_m) brennis:set_talk_chore(8, brennis_on_fire_o) brennis:set_talk_chore(9, brennis_on_fire_t) brennis:set_talk_chore(10, brennis_on_fire_u) brennis:play_chore(brennis_on_fire_on_fire, "brennis_on_fire.cos") brennis:wait_for_chore(brennis_on_fire_on_fire, "brennis_on_fire.cos") else brennis:stop_chore() brennis:set_costume("brennis_on_fire.cos") brennis:set_mumble_chore(brennis_on_fire_mumble) brennis:set_talk_chore(1, brennis_on_fire_stop_talk) brennis:set_talk_chore(2, brennis_on_fire_a) brennis:set_talk_chore(3, brennis_on_fire_c) brennis:set_talk_chore(4, brennis_on_fire_e) brennis:set_talk_chore(5, brennis_on_fire_f) brennis:set_talk_chore(6, brennis_on_fire_l) brennis:set_talk_chore(7, brennis_on_fire_m) brennis:set_talk_chore(8, brennis_on_fire_o) brennis:set_talk_chore(9, brennis_on_fire_t) brennis:set_talk_chore(10, brennis_on_fire_u) brennis:say_line("/tubs050/") manny:face_entity(tu.brennis_obj) end brennis:play_chore(brennis_on_fire_pat_flames, "brennis_on_fire.cos") start_sfx("brSpark.WAV") tu.flames:play_chore(tu_fire_sparks, "tu_fire.cos") sleep_for(200) start_sfx("brExplo.WAV") tu.flames.interest_actor:wait_for_chore(tu_fire_sparks, "tu_fire.cos") if not arg2 then brennis:say_line("/tubs050/") end sleep_for(150) start_sfx("brFire.IMU") brennis:wait_for_message() fade_sfx("brFire.IMU", 1500) if bd.extinguisher.owner ~= manny then tu:current_setup(tu_tubws) if not arg2 then manny:setpos(1.44547, -0.40514901, 0) manny:setrot(0, 32.306999, 0) manny:head_look_at(nil) end manny:runto(tu.extinguisher.use_pnt_x, tu.extinguisher.use_pnt_y, tu.extinguisher.use_pnt_z, tu.extinguisher.use_rot_x, tu.extinguisher.use_rot_y, tu.extinguisher.use_rot_z) manny:wait_for_actor() manny:set_time_scale(3) start_sfx("tuGetExt.wav") tu.extinguisher:pickUp() manny:set_time_scale(1) start_script(manny.runto, manny, 1.44547, -0.40514901, 0) sleep_for(1000) tu:current_setup(tu_dorcu) manny:put_at_object(tu.brennis_obj) manny:set_run(FALSE) else tu:current_setup(0) if proximity(manny.hActor, tu.brennis_obj.use_pnt_x, tu.brennis_obj.use_pnt_y, tu.brennis_obj.use_pnt_z) > 0.1 then manny:runto(tu.brennis_obj.use_pnt_x, tu.brennis_obj.use_pnt_y, tu.brennis_obj.use_pnt_z) manny:wait_for_actor() else manny:put_at_object(tu.brennis_obj) sleep_for(400) end manny:head_look_at(nil) if manny.is_holding ~= bd.extinguisher then manny:setrot(0, 172.51601, 0, TRUE) manny:pull_out_item(bd.extinguisher) end manny:setrot(tu.brennis_obj.use_rot_x, tu.brennis_obj.use_rot_y, tu.brennis_obj.use_rot_z, TRUE) end brennis:play_chore(brennis_on_fire_stop_manny, "brennis_on_fire.cos") brennis:say_line("/tubs051/") brennis:wait_for_message() brennis:say_line("/tubs052/") brennis:wait_for_message() brennis:say_line("/tubs053/") brennis:wait_for_message() local1, local2, local3 = GetActorNodeLocation(system.currentActor.hActor, 12) manny:head_look_at_point(local1, local2, local3) brennis:say_line("/tubs054/") brennis:wait_for_message() manny:head_look_at(nil) manny:say_line("/tuma055/") manny:wait_for_message() brennis:say_line("/tubs056/") sleep_for(500) brennis:play_chore(brennis_on_fire_turn_around, "brennis_on_fire.cos") brennis:wait_for_message() manny:stop_chore(ms_hold, "ms.cos") manny:play_chore(ms_putback_big, "ms.cos") manny:wait_for_chore(ms_putback_big, "ms.cos") manny:stop_chore(ms_putback_big, "ms.cos") manny:stop_chore(ms_activate_extinguisher, "ms.cos") manny:play_chore(ms_putback_done, "ms.cos") manny:wait_for_chore(ms_putback_done, "ms.cos") manny:stop_chore(ms_putback_done, "ms.cos") manny.is_holding = nil brennis:wait_for_chore(brennis_on_fire_turn_around, "brennis_on_fire.cos") brennis:set_costume("brennis_fix_idle.cos") brennis:set_mumble_chore(brennis_fix_idle_mumble) brennis:set_talk_chore(1, brennis_fix_idle_stop_talk) brennis:set_talk_chore(2, brennis_fix_idle_a) brennis:set_talk_chore(3, brennis_fix_idle_c) brennis:set_talk_chore(4, brennis_fix_idle_e) brennis:set_talk_chore(5, brennis_fix_idle_f) brennis:set_talk_chore(6, brennis_fix_idle_l) brennis:set_talk_chore(7, brennis_fix_idle_m) brennis:set_talk_chore(8, brennis_fix_idle_o) brennis:set_talk_chore(9, brennis_fix_idle_t) brennis:set_talk_chore(10, brennis_fix_idle_u) tu:current_setup(tu_dorcu) cameraman_disabled = FALSE END_CUT_SCENE() start_script(brennis.idle, brennis) end brennis.leave = function(arg1) -- line 528 START_CUT_SCENE() tu.chem_state = "no chem" tu:current_setup(tu_dorcu) brennis:stop_idle() tu:current_setup(tu_redcu) manny:set_visibility(FALSE) brennis:set_costume("br_grab_card.cos") brennis:setpos(0, 0, 0) brennis:setrot(0, 180, 0) brennis:play_chore(0, "br_grab_card.cos") brennis:wait_for_chore(0, "br_grab_card.cos") tu:current_setup(tu_dorcu) tu.switcher.interest_actor:play_chore(tu_switcher_still, "tu_switcher.cos") brennis:set_costume(nil) brennis:default() brennis:put_in_set(tu) brennis:setpos(0.27442, -0.4735, 0) brennis:setrot(0, 31.834, 0) brennis:set_mumble_chore(brennis_fix_idle_mumble) brennis:set_talk_chore(1, brennis_fix_idle_stop_talk) brennis:set_talk_chore(2, brennis_fix_idle_a) brennis:set_talk_chore(3, brennis_fix_idle_c) brennis:set_talk_chore(4, brennis_fix_idle_e) brennis:set_talk_chore(5, brennis_fix_idle_f) brennis:set_talk_chore(6, brennis_fix_idle_l) brennis:set_talk_chore(7, brennis_fix_idle_m) brennis:set_talk_chore(8, brennis_fix_idle_o) brennis:set_talk_chore(9, brennis_fix_idle_t) brennis:set_talk_chore(10, brennis_fix_idle_u) brennis:play_chore(brennis_fix_idle_exit_tube_room, "brennis_fix_idle.cos") sleep_for(300) start_sfx("tuFanOn.WAV", nil, 90) tu.fans.interest_actor:play_chore_looping(tu_fans_spin_door_open, "tu_fans.cos") wait_for_sound("tuFanOn.WAV") single_start_sfx("tuFanLp.IMU", nil, tu.fan_volume) single_start_sfx("tuSwtch.IMU", nil, tu.switcher_volume) brennis:say_line("/tubs057/") sleep_for(5000) if tu.open_bolt:is_locked() then tu.door_state = "ajar" tu:set_up_switcher_door() play_movie("tu_db.snm", 2, 16) wait_for_movie() else tu.door_state = "closed" tu:set_up_switcher_door() play_movie("tu_dwb.snm", 66, 16) wait_for_movie() end if tu.open_bolt:is_locked() then tu.switcher_door:play_chore(tu_switcher_door_ajar) else tu.switcher_door:play_chore(tu_switcher_door_closed) end tu.switcher.interest_actor:play_chore_looping(tu_switcher_switch, "tu_switcher.cos") brennis:wait_for_message() brennis:wait_for_chore(brennis_fix_idle_exit_tube_room, "brennis_fix_idle.cos") manny:set_visibility(TRUE) END_CUT_SCENE() tu:set_up_states() end brennis.idle = function(arg1) -- line 605 arg1.turned_to_talk = FALSE while TRUE do arg1.is_scratching = FALSE arg1:play_chore(brennis_fix_idle_fix_idle, "brennis_fix_idle.cos") arg1:wait_for_chore(brennis_fix_idle_fix_idle, "brennis_fix_idle.cos") if rnd(8) then arg1.is_scratching = TRUE arg1:play_chore(brennis_fix_idle_buttscratch, "brennis_fix_idle.cos") arg1:wait_for_chore(brennis_fix_idle_buttscratch, "brennis_fix_idle.cos") end end end brennis.stop_idle = function(arg1) -- line 619 if find_script(brennis.stop_talking) then wait_for_script(brennis.stop_talking) end stop_script(arg1.idle) arg1:wait_for_chore() end brennis.start_talking = function(arg1) -- line 627 if not arg1.turned_to_talk then arg1:stop_idle() arg1:play_chore(brennis_fix_idle_to_talk, "brennis_fix_idle.cos") arg1:wait_for_chore(brennis_fix_idle_to_talk, "brennis_fix_idle.cos") arg1:play_chore_looping(brennis_fix_idle_talk_hold, "brennis_fix_idle.cos") arg1.turned_to_talk = TRUE end end brennis.stop_talking = function(arg1) -- line 637 if arg1.turned_to_talk then arg1:stop_chore(brennis_fix_idle_talk_hold, "brennis_fix_idle.cos") arg1:play_chore(brennis_fix_idle_back_to_fix_idle, "brennis_fix_idle.cos") arg1:wait_for_chore(brennis_fix_idle_back_to_fix_idle, "brennis_fix_idle.cos") arg1.turned_to_talk = FALSE single_start_script(arg1.idle, arg1) end end tu.enter = function(arg1) -- line 654 tu.burn_box.triggered = FALSE tu.switcher_door:make_untouchable() tu.fans:make_untouchable() tu.flames:make_untouchable() tu:set_up_object_states() tu:set_up_actors() tu:set_up_states() tu:camerachange(nil, tu:current_setup()) LoadCostume("ma_operate_bolt.cos") LoadCostume("ma_wheel_stuck.cos") LoadCostume("ma_tube_action.cos") LoadCostume("brennis_fix_idle.cos") end tu.exit = function(arg1) -- line 672 stop_script(brennis.idle) stop_script(brennis.stop_idle) brennis:free() stop_sound("tuFanLp.IMU") stop_sound("tuFanOn.WAV") stop_sound("tuFanOff.WAV") stop_sound("tubAirNb.IMU") stop_sound("tubAirPb.IMU") stop_sound("tubAirFb.IMU") stop_sound("tubCnVib.IMU") stop_sound("tuSwtch.IMU") end tu.camerachange = function(arg1, arg2, arg3) -- line 686 tu.switcher:make_touchable() tu.red_tube:make_touchable() if arg3 == tu_dorcu then tu.switcher:make_untouchable() brennis.seen_working_this_time = TRUE elseif arg3 == tu_redcu then tu.switcher:make_untouchable() elseif arg3 == tu_swiha or arg3 == tu_swopn then tu.switcher:inside_use_point() elseif arg3 == tu_tubws then tu.switcher:side_use_point() elseif arg3 == tu_swicu then tu.switcher:inside_use_point() tu.red_tube:make_untouchable() end if arg3 == tu_redcu and tu.chem_state ~= "both chem" then single_start_sfx("tubAirNb.IMU") else stop_sound("tubAirNb.IMU") end if arg3 == tu_dorcu then if tu.open_bolt.locked and tu.door_state == "open" then tu.open_bolt:play_chore(tu_deadbolt_here) end end end tu.cameraman = function(arg1) -- line 720 local local1, local2 local local3 local local4 if cameraman_disabled == FALSE and arg1:current_setup() ~= arg1.setups.overhead then local4 = system.currentActor:find_sector_name(tostring(cameraman_box_name)) if not local4 or arg1 ~= cameraman_watching_set then arg1.cameraChange = TRUE cameraman_watching_set = arg1 local1, cameraman_box_name, local2 = system.currentActor:find_sector_type(CAMERA) local3 = arg1.setups[tostring(cameraman_box_name)] if local3 == tu_swiha and tu.door_state == "open" then local3 = tu_swopn end arg1:current_setup(local3) else arg1.cameraChange = FALSE end end end tu.update_music_state = function(arg1) -- line 747 if tu.chem_state == "both chem" then return stateTU_BRENNIS else return stateTU end end tu.manny_lock_deadbolt = function(arg1, arg2) -- line 755 manny:push_costume("ma_operate_bolt.cos") if arg2 then tu.open_bolt:play_chore(tu_deadbolt_here_unlocked) manny:play_chore(ma_operate_bolt_lock_bolt, "ma_operate_bolt.cos") sleep_for(533) tu.open_bolt:play_chore(tu_deadbolt_lock, "tu_deadbolt.cos") else tu.open_bolt:play_chore(tu_deadbolt_here) manny:play_chore(ma_operate_bolt_unlock_bolt, "ma_operate_bolt.cos") sleep_for(533) tu.open_bolt:play_chore(tu_deadbolt_unlock, "tu_deadbolt.cos") end manny:wait_for_chore() manny:pop_costume() end tu.door_wheel = Object:create(tu, "/tutx058/wheel", 0.61358398, -0.835706, 0.31, { range = 0.5 }) tu.door_wheel.use_pnt_x = 0.80013198 tu.door_wheel.use_pnt_y = -0.93841499 tu.door_wheel.use_pnt_z = 0 tu.door_wheel.use_rot_x = 0 tu.door_wheel.use_rot_y = 52.717899 tu.door_wheel.use_rot_z = 0 tu.door_wheel.lookAt = function(arg1) -- line 788 manny:say_line("/tuma059/") end tu.door_wheel.use = function(arg1) -- line 792 local local1 if tu.door_state == "ajar" then START_CUT_SCENE() manny:walkto_object(arg1) manny:push_costume("ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:wait_for_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:set_walk_chore(ms_back_off, manny.base_costume) manny:set_walk_rate(-0.11) play_movie("tu_dob.snm", 2, 16) local1 = 0 while local1 < 1300 do WalkActorForward(manny.hActor) break_here() local1 = local1 + system.frameTime end StopMovie() manny:set_walk_backwards(FALSE) manny:stop_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:pop_costume() tu.door_state = "open" tu.open_bolt.locked = TRUE FreeObjectState(tu.switcher_door.hObjectState) tu.switcher_door.hObjectState = nil tu:set_up_states() SendObjectToFront(tu.open_bolt.hObjectState) tu.open_bolt:complete_chore(tu_deadbolt_here, "tu_deadbolt.cos") tu:current_setup(tu_swopn) manny:setpos(0.97562599, -1.18225, 0) manny:setrot(0, 358.32401, 0) manny:head_look_at(nil) sleep_for(500) manny:walkto(0.44540301, -0.66003799, 0, 0, 46.101501, 0) manny:wait_for_actor() END_CUT_SCENE() else START_CUT_SCENE() manny:walkto_object(arg1) manny:push_costume("ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:wait_for_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_turn_tu, "ma_wheel_stuck.cos") manny:play_sound_at("valvtwst.wav") manny:wait_for_chore(ma_wheel_stuck_turn_tu, "ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_hand_off_tu, "ma_wheel_stuck.cos") manny:wait_for_chore(ma_wheel_stuck_hand_off_tu, "ma_wheel_stuck.cos") manny:pop_costume() manny:say_line("/tuma060/") manny:wait_for_message() if not tu.closed_bolt:is_locked() then manny:say_line("/tuma061/") end END_CUT_SCENE() end end tu.closed_bolt = Object:create(tu, "/tutx062/deadbolt", 0.473584, -0.955706, 0.36000001, { range = 0.5 }) tu.closed_bolt.use_pnt_x = 0.62627202 tu.closed_bolt.use_pnt_y = -1.05899 tu.closed_bolt.use_pnt_z = 0 tu.closed_bolt.use_rot_x = 0 tu.closed_bolt.use_rot_y = 90.141098 tu.closed_bolt.use_rot_z = 0 tu.closed_bolt.lookAt = function(arg1) -- line 865 if arg1:is_locked() then manny:say_line("/tuma063/") else manny:say_line("/tuma064/") end end tu.closed_bolt.use = function(arg1) -- line 874 if tu.door_state == "ajar" then manny:say_line("/tuma065/") else system.default_response("with what") end end tu.closed_bolt:lock() tu.open_bolt = Object:create(tu, "/tutx067/dead bolt", 1.05984, -0.93449301, 0.38, { range = 0.5 }) tu.open_bolt.use_pnt_x = 0.84163702 tu.open_bolt.use_pnt_y = -1.0251 tu.open_bolt.use_pnt_z = 0 tu.open_bolt.use_rot_x = 0 tu.open_bolt.use_rot_y = 327.87601 tu.open_bolt.use_rot_z = 0 tu.open_bolt.lookAt = function(arg1) -- line 893 tu.closed_bolt.lookAt(arg1) end tu.open_bolt.use = function(arg1) -- line 897 if arg1:is_locked() then START_CUT_SCENE() cur_puzzle_state[5] = FALSE manny:walkto_object(arg1) arg1:unlock() tu.closed_bolt:unlock() tu:manny_lock_deadbolt(FALSE) END_CUT_SCENE() else START_CUT_SCENE() cur_puzzle_state[5] = TRUE manny:walkto_object(arg1) arg1:lock() tu.closed_bolt:lock() tu:manny_lock_deadbolt(TRUE) if not arg1.ever_locked then arg1.ever_locked = TRUE manny:say_line("/tuma068/") wait_for_message() manny:say_line("/tuma069/") end END_CUT_SCENE() end end tu.open_bolt:unlock() tu.open_bolt.make_untouchable = function(arg1) -- line 925 arg1:play_chore(tu_deadbolt_gone, "tu_deadbolt.cos") Object.make_untouchable(arg1) end tu.open_bolt.make_touchable = function(arg1) -- line 931 if arg1:is_locked() then arg1:play_chore(tu_deadbolt_here_unlocked, "tu_deadbolt.cos") else arg1:play_chore(tu_deadbolt_here, "tu_deadbolt.cos") end Object.make_touchable(arg1) end tu.open_wheel = Object:create(tu, "/tutx070/wheel", 0.83358401, -0.77570599, 0.23999999, { range = 0.5 }) tu.open_wheel.use_pnt_x = 0.80046499 tu.open_wheel.use_pnt_y = -1.03627 tu.open_wheel.use_pnt_z = 0 tu.open_wheel.use_rot_x = 0 tu.open_wheel.use_rot_y = 325.18799 tu.open_wheel.use_rot_z = 0 tu.open_wheel.lookAt = function(arg1) -- line 952 manny:say_line("/tuma071/") end tu.open_wheel.use = function(arg1) -- line 956 START_CUT_SCENE() manny:walkto_object(arg1) manny:push_costume("ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:wait_for_chore(ma_wheel_stuck_hand_on_tu, "ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_turn_tu, "ma_wheel_stuck.cos") manny:play_sound_at("valvtwst.wav") manny:wait_for_chore(ma_wheel_stuck_turn_tu, "ma_wheel_stuck.cos") manny:play_chore(ma_wheel_stuck_hand_off_tu, "ma_wheel_stuck.cos") manny:wait_for_chore(ma_wheel_stuck_hand_off_tu, "ma_wheel_stuck.cos") manny:pop_costume() manny:say_line("/tuma072/") END_CUT_SCENE() end tu.brennis_obj = Object:create(tu, "/tutx073/repairman", 0.39063501, -0.48363599, 0.40000001, { range = 0.89999998 }) tu.brennis_obj.use_pnt_x = 0.71560103 tu.brennis_obj.use_pnt_y = -0.89723903 tu.brennis_obj.use_pnt_z = 0 tu.brennis_obj.use_rot_x = 0 tu.brennis_obj.use_rot_y = 56.1894 tu.brennis_obj.use_rot_z = 0 tu.brennis_obj.lookAt = function(arg1) -- line 982 manny:say_line("/tuma074/") end tu.brennis_obj.use = function(arg1) -- line 986 START_CUT_SCENE() manny:walkto_object(arg1) END_CUT_SCENE() if br1 then br1:init() else result = dofile("dlg_brennis.lua") if not result then br1:init() else brennis:leave() end end end tu.red_tube = Object:create(tu, "/tutx075/red tube", 0.64748901, -0.162466, 0.36000001, { range = 0.80000001 }) tu.red_tube.use_pnt_x = 0.55390501 tu.red_tube.use_pnt_y = -0.298289 tu.red_tube.use_pnt_z = 0 tu.red_tube.use_rot_x = 0 tu.red_tube.use_rot_y = 4.2853999 tu.red_tube.use_rot_z = 0 tu.red_tube.closeup_use_pnt_x = 0.55000001 tu.red_tube.closeup_use_pnt_y = -0.29300001 tu.red_tube.closeup_use_pnt_z = 0 tu.red_tube.closeup_use_rot_x = 0 tu.red_tube.closeup_use_rot_y = 2164.27 tu.red_tube.closeup_use_rot_z = 0 tu.red_tube.lookAt = function(arg1) -- line 1025 local local1 START_CUT_SCENE() local1 = tu:current_setup() tu:current_setup(tu_redcu) if rnd(5) and tu.chem_state ~= "both chem" then start_script(tu.send_canister_through, tu) end if arg1.seen and not arg1.pondered then arg1.pondered = TRUE arg1:ponder() else arg1.seen = TRUE manny:say_line("/tuma076/") end manny:wait_for_message() tu:current_setup(local1) END_CUT_SCENE() end tu.red_tube.use = function(arg1) -- line 1048 if tu.door_state == "open" and tu.chem_state ~= "both chem" then if not tu.red_tube.seen_locked then if manny:walkto_object(arg1) then tu.red_tube.seen_locked = TRUE START_CUT_SCENE() manny:walkto_object(tu.red_tube) tu:current_setup(tu_redcu) if rnd(5) then start_script(tu.send_canister_through, tu) end manny:ignore_boxes() manny:setpos(0.521, -0.31933, 0.0120163) manny:setrot(0, 4.68058, 0) manny:push_costume("ma_tube_action.cos") manny:play_chore(ma_tube_action_handle_shake, "ma_tube_action.cos") manny:wait_for_chore() manny:pop_costume() manny:follow_boxes() manny:put_at_object(tu.red_tube) tu:current_setup(tu_swopn) END_CUT_SCENE() system.default_response("locked") end else system.default_response("locked") end else system.default_response("reach") end end tu.red_tube.use_card = function(arg1, arg2) -- line 1080 if tu.door_state ~= "open" or tu.chem_state == "both chem" then system.default_response("reach") else arg2:free() manny:stop_chore(ms_hold_card, "ms.cos") manny:stop_chore(ms_activate_hole_card, "ms.cos") manny.is_holding = nil if arg2.punched then cur_puzzle_state[6] = TRUE START_CUT_SCENE() tu:current_setup(tu_redcu) manny:ignore_boxes() manny:stop_chore(ms_hold, "ms.cos") manny:setpos(0.485339, -0.311661, 0) manny:setrot(0, 359.564, 0) manny:stop_chore(ms_hold, "ms.cos") manny:stop_chore(ms_hold_card, "ms.cos") manny:push_costume("ma_tube_action.cos") manny:play_chore(ma_tube_action_canister_stop, "ma_tube_action.cos") sleep_for(1000) stop_sound("tubAirNb.IMU") start_sfx("tubAirPb.IMU") sleep_for(3600) tu.red_tube:play_chore(tu_canister_stop, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore() start_sfx("tubCnVib.IMU") tu.red_tube.interest_actor:play_chore_looping(tu_canister_stop_loop, "tu_canister.cos") manny:wait_for_chore(ma_tube_action_canister_stop, "ma_tube_action.cos") manny:play_chore_looping(ma_tube_action_canister_hold, "ma_tube_action.cos") manny:say_line("/tuma078/") wait_for_message() manny:say_line("/tuma079/") wait_for_message() manny:say_line("/tuma080/") wait_for_message() manny:say_line("/tuma081/") wait_for_message() manny:stop_chore(ma_tube_action_canister_hold, "ma_tube_action.cos") manny:play_chore(ma_tube_action_canister_letgo, "ma_tube_action.cos") sleep_for(200) start_sfx("tubCnPas.WAV") sleep_for(400) stop_sound("tubCnVib.IMU") tu.red_tube.interest_actor:stop_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:play_chore(tu_canister_go, "tu_canister.cos") stop_sound("tubAirPb.IMU") start_sfx("tubAirNb.IMU") manny:wait_for_chore() manny:pop_costume() manny:follow_boxes() manny:put_at_object(tu.red_tube) tu:current_setup(tu_swopn) break_here() manny:say_line("/tuma082/") wait_for_message() tu:current_setup(tu_dorcu) manny:say_line("/tuma083/") manny:walkto(1.2208, -1.16499, 0, 0, 351.67, 0) manny:wait_for_message() break_here() stop_sound("tuFanLp.IMU") stop_sound("tubAirPb.IMU") stop_sound("tubAirNb.IMU") stop_sound("tubCnVib.IMU") stop_sound("tuSwtch.IMU") END_CUT_SCENE() start_script(cut_scene.bonewgn) else START_CUT_SCENE() tu:current_setup(tu_redcu) manny:ignore_boxes() manny:setpos(0.485339, -0.311661, 0) manny:setrot(0, 359.564, 0) manny:stop_chore(ms_hold, "ms.cos") manny:stop_chore(ms_hold_card, "ms.cos") manny:push_costume("ma_tube_action.cos") manny:play_chore(ma_tube_action_lose_card, "ma_tube_action.cos") sleep_for(1200) stop_sound("tubAirNb.IMU") start_sfx("tubAirFb.IMU") sleep_for(800) tu.red_tube.interest_actor:play_chore(tu_canister_stop, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_stop, "tu_canister.cos") tu.red_tube.interest_actor:play_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_stop_loop, "tu_canister.cos") start_sfx("tubCdLos.wav") wait_for_sound("tubCdLos.wav") start_sfx("tubCnPas.WAV") tu.red_tube.interest_actor:play_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:play_chore(tu_canister_go, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:play_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_stop_loop, "tu_canister.cos") tu.red_tube.interest_actor:play_chore(tu_canister_go, "tu_canister.cos") tu.red_tube.interest_actor:wait_for_chore(tu_canister_go, "tu_canister.cos") stop_sound("tubAirFb.IMU") start_sfx("tubAirNb.IMU") manny:wait_for_chore(ma_tube_action_lose_card, "ma_tube_action.cos") manny:pop_costume() manny:follow_boxes() manny:put_at_object(tu.red_tube) tu:current_setup(tu_swopn) break_here() manny:say_line("/tuma085/") END_CUT_SCENE() end end end tu.red_tube.ponder = function(arg1) -- line 1208 manny:say_line("/tuma093/") manny:wait_for_message() manny:say_line("/tuma094/") end tu.red_tube.use_cards = function(arg1) -- line 1214 if tu.door_state ~= "open" or tu.chem_state == "both chem" then system.default_response("reach") else mo.cards:switch_to_one() tu.red_tube:use_card(mo.one_card) end end tu.switcher = Object:create(tu, "/tutx086/switcher", 0.0035840999, 0.014294, 0.55000001, { range = 1.5 }) tu.switcher.inside_use_point = function(arg1) -- line 1226 tu.switcher.use_pnt_x = 0.431 tu.switcher.use_pnt_y = -0.397 tu.switcher.use_pnt_z = 0 tu.switcher.use_rot_x = 0 tu.switcher.use_rot_y = 2211.66 tu.switcher.use_rot_z = 0 end tu.switcher.side_use_point = function(arg1) -- line 1235 tu.switcher.use_pnt_x = 0.812 tu.switcher.use_pnt_y = 0.819 tu.switcher.use_pnt_z = 0 tu.switcher.use_rot_x = 0 tu.switcher.use_rot_y = 2323.98 tu.switcher.use_rot_z = 0 end tu.switcher.front_use_point = function(arg1) -- line 1244 tu.switcher.use_pnt_x = 1.158 tu.switcher.use_pnt_y = -0.106 tu.switcher.use_pnt_z = 0 tu.switcher.use_rot_x = 0 tu.switcher.use_rot_y = 2243.52 tu.switcher.use_rot_z = 0 end tu.switcher:side_use_point() tu.switcher.lookAt = function(arg1) -- line 1255 if tu.chem_state == "chem 1" then manny:say_line("/tuma087/") elseif tu.chem_state == "chem 2" then manny:say_line("/tuma088/") elseif tu.chem_state == "both chem" then manny:say_line("/tuma089/") else manny:say_line("/tuma090/") end end tu.switcher.use = function(arg1) -- line 1267 manny:say_line("/tuma091/") end tu.fans = Object:create(tu, "fans", 0, 0, 0, { range = 0 }) tu.switcher_door = Object:create(tu, "switcher door", 1, -1, 0, { range = 0 }) tu.flames = Object:create(tu, "flames", 0.0035840999, 0.014294, 0.55000001, { range = 0 }) tu.extinguisher = Object:create(tu, "/bdtx018/fire extinguisher", 1.24414, 1.46034, 0.31990001, { range = 0.60000002 }) tu.extinguisher.string_name = "extinguisher" tu.extinguisher.big = TRUE tu.extinguisher.wav = "getMetl.wav" tu.extinguisher.use_pnt_x = 1.32596 tu.extinguisher.use_pnt_y = 1.24541 tu.extinguisher.use_pnt_z = 0 tu.extinguisher.use_rot_x = 0 tu.extinguisher.use_rot_y = 30.280001 tu.extinguisher.use_rot_z = 0 tu.extinguisher.lookAt = function(arg1) -- line 1298 manny:say_line("/vima035/") end tu.extinguisher.pickUp = function(arg1) -- line 1302 if manny:walkto_object(arg1) then START_CUT_SCENE() manny:play_chore(ms_hand_on_obj, "ms.cos") manny:wait_for_chore() sleep_for(100 / GetActorTimeScale(manny.hActor)) arg1:make_disappear() bd.extinguisher:get() manny:stop_chore(ms_hand_on_obj, "ms.cos") start_sfx("tuGetExt.wav") manny:play_chore(ms_activate_extinguisher, "ms.cos") manny:play_chore(ms_hand_off_obj, "ms.cos") sleep_for(400 / GetActorTimeScale(manny.hActor)) manny:stop_chore(ms_hand_off_obj, "ms.cos") manny:play_chore(ms_hold, "ms.cos") manny.is_holding = bd.extinguisher manny.hold_chore = ms_activate_extinguisher END_CUT_SCENE() end end tu.extinguisher.use = tu.extinguisher.pickUp tu.extinguisher.make_disappear = function(arg1) -- line 1325 arg1.interest_actor:play_chore(1) arg1:make_untouchable() end tu.lo_door = Object:create(tu, "/tutx092/door", 1.57358, 1.8042901, 0.5, { range = 0.5 }) tu.tu_lo_box = tu.lo_door tu.lo_door.use_pnt_x = 1.5089999 tu.lo_door.use_pnt_y = 1.286 tu.lo_door.use_pnt_z = 0 tu.lo_door.use_rot_x = 0 tu.lo_door.use_rot_y = 718.34698 tu.lo_door.use_rot_z = 0 tu.lo_door.out_pnt_x = 1.58289 tu.lo_door.out_pnt_y = 1.74386 tu.lo_door.out_pnt_z = 0 tu.lo_door.out_rot_x = 0 tu.lo_door.out_rot_y = 712.00201 tu.lo_door.out_rot_z = 0 tu.lo_door.walkOut = function(arg1) -- line 1354 if tu.chem_state == "both chem" and brennis.seen_working_this_time then brennis:leave() end lo:come_out_door(lo.tu_door) end tu.burn_box = { } tu.burn_box.name = "burn box" tu.burn_box.triggered = FALSE tu.burn_box.walkOut = function(arg1) -- line 1365 if not arg1.triggered then arg1.triggered = TRUE elseif tu.chem_state == "both chem" and not brennis.burnt then brennis:burn(TRUE) end end CheckFirstTime("tp.lua") dofile("tp_interface.lua") tp = Set:create("tp.set", "ticket printer", { tp_tckcu = 0 }) tp.current_button = nil tp.week = nil tp.day = nil tp.race = nil tp.RACE = 1 tp.DAY = 2 tp.WEEK = 3 tp.PRINT = 4 system.digitTemplate = { name = "<unnamed>", x = nil, y = nil, elements = nil } Digit = system.digitTemplate Digit.create = function(arg1, arg2, arg3, arg4) -- line 45 local local1 = { } local local2 = 1 local1.parent = Digit local1.name = arg2 local1.x = arg3 local1.y = arg4 local1.elements = { } repeat local1.elements[local2] = DrawLine(tp.basenumber[local2].x1 + local1.x, tp.basenumber[local2].y1 + local1.y, tp.basenumber[local2].x2 + local1.x, tp.basenumber[local2].y2 + local1.y, { color = tp.text_color_dim, layer = 1 }) local2 = local2 + 1 until local2 == 14 return local1 end Digit.draw_number = function(arg1, arg2) -- line 68 local local1 = 1 repeat ChangePrimitive(arg1.elements[local1], { color = tp.text_color_dim, layer = 1 }) local1 = local1 + 1 until local1 == 14 local1 = 1 repeat ChangePrimitive(arg1.elements[tp.number[arg2][local1]], { color = tp.text_color_bright, layer = 1 }) local1 = local1 + 1 until not tp.number[arg2][local1] end Digit.draw_char = function(arg1, arg2) -- line 83 local local1 = 1 repeat ChangePrimitive(arg1.elements[local1], { color = tp.text_color_dim, layer = 1 }) local1 = local1 + 1 until local1 == 14 local1 = 1 repeat if tp.letter[arg2][local1] then ChangePrimitive(arg1.elements[tp.letter[arg2][local1]], { color = tp.text_color_bright, layer = 1 }) end local1 = local1 + 1 until not tp.letter[arg2][local1] end Digit.destroy = function(arg1) -- line 101 local local1 = 1 repeat KillPrimitive(arg1.elements[local1]) local1 = local1 + 1 until local1 == 14 end system.ledTemplate = { name = "<unnamed>", digits = nil, num_digits = 0 } Led = system.ledTemplate Led.create = function(arg1, arg2) -- line 120 local local1 = { } local local2 = 1 local1.parent = Led local1.name = arg2 local1.digits = { } local1.num_digits = 0 return local1 end Led.add_digit = function(arg1, arg2, arg3) -- line 133 local local1 = arg1.num_digits + 1 arg1.digits[local1] = Digit:create("digit " .. local1, arg2, arg3) arg1.num_digits = arg1.num_digits + 1 end Led.display_number = function(arg1, arg2) -- line 141 local local1 = arg1.num_digits local local2, local3 if arg2 > 9 then local2 = floor(arg2 / 10) local3 = mod(arg2, 10) else local2 = 0 local3 = arg2 end arg1.digits[local1]:draw_number(local3) local1 = local1 - 1 arg1.digits[local1]:draw_number(local2) local1 = local1 - 1 while arg1.digits[local1] do arg1.digits[local1]:draw_number(0) local1 = local1 - 1 end end Led.display_str = function(arg1, arg2) -- line 164 local local1 = 1 local local2 arg2 = LocalizeString(arg2) arg2 = trim_header(arg2) arg2 = americanize_string(arg2) repeat local2 = strsub(arg2, local1, local1) if local2 then arg1.digits[local1]:draw_char(local2) local1 = local1 + 1 end until local1 > arg1.num_digits or not local2 end americanize_string = function(arg1) -- line 181 local local1 = { } local local2 local local3, local4, local5, local6 local1.A = "\192\193\194\195\196\197\198\224\225\226\227\228\229\230" local1.C = "\199\231" local1.E = "\200\201\202\203\232\233\234\235" local1.I = "\204\205\206\207\236\237\238\239" local1.N = "\209\241" local1.O = "\210\211\212\213\214\242\243\244\245\246\248\216" local1.U = "\217\218\219\220\249\250\251\252" local1.Y = "\221\159\253\255" local1.OE = "\140\156" local1.AE = "\198\230" local1.S = "\154\138" local1.SS = "\223" local2 = arg1 local3, local4 = next(local1, nil) while local3 do local6 = strlen(local4) local5 = 1 while local5 <= local6 do local2 = gsub(local2, strsub(local4, local5, local5), local3) local5 = local5 + 1 end local3, local4 = next(local1, local3) end local2 = strlower(local2) return local2 end Led.destroy = function(arg1) -- line 216 local local1 = 1 repeat arg1.digits[local1]:destroy() local1 = local1 + 1 until local1 > arg1.num_digits end tp.init_number_tables = function() -- line 238 tp.basenumber = { } tp.basenumber[1] = { } tp.basenumber[2] = { } tp.basenumber[3] = { } tp.basenumber[4] = { } tp.basenumber[5] = { } tp.basenumber[6] = { } tp.basenumber[7] = { } tp.basenumber[8] = { } tp.basenumber[9] = { } tp.basenumber[10] = { } tp.basenumber[11] = { } tp.basenumber[12] = { } tp.basenumber[13] = { } tp.basenumber[1].x1 = 1 tp.basenumber[1].y1 = 0 tp.basenumber[1].x2 = 12 tp.basenumber[1].y2 = 0 tp.basenumber[2].x1 = 0 tp.basenumber[2].y1 = 1 tp.basenumber[2].x2 = 0 tp.basenumber[2].y2 = 13 tp.basenumber[3].x1 = 13 tp.basenumber[3].y1 = 1 tp.basenumber[3].x2 = 13 tp.basenumber[3].y2 = 13 tp.basenumber[4].x1 = 1 tp.basenumber[4].y1 = 14 tp.basenumber[4].x2 = 12 tp.basenumber[4].y2 = 14 tp.basenumber[5].x1 = 0 tp.basenumber[5].y1 = 15 tp.basenumber[5].x2 = 0 tp.basenumber[5].y2 = 27 tp.basenumber[6].x1 = 13 tp.basenumber[6].y1 = 15 tp.basenumber[6].x2 = 13 tp.basenumber[6].y2 = 27 tp.basenumber[7].x1 = 1 tp.basenumber[7].y1 = 28 tp.basenumber[7].x2 = 12 tp.basenumber[7].y2 = 28 tp.basenumber[8].x1 = 6 tp.basenumber[8].y1 = 1 tp.basenumber[8].x2 = 6 tp.basenumber[8].y2 = 12 tp.basenumber[9].x1 = 6 tp.basenumber[9].y1 = 15 tp.basenumber[9].x2 = 6 tp.basenumber[9].y2 = 27 tp.basenumber[10].x1 = 1 tp.basenumber[10].y1 = 26 tp.basenumber[10].x2 = 5 tp.basenumber[10].y2 = 15 tp.basenumber[11].x1 = 7 tp.basenumber[11].y1 = 12 tp.basenumber[11].x2 = 12 tp.basenumber[11].y2 = 1 tp.basenumber[12].x1 = 1 tp.basenumber[12].y1 = 1 tp.basenumber[12].x2 = 5 tp.basenumber[12].y2 = 12 tp.basenumber[13].x1 = 7 tp.basenumber[13].y1 = 15 tp.basenumber[13].x2 = 11 tp.basenumber[13].y2 = 26 tp.number = { } tp.number[0] = { } tp.number[0][1] = 1 tp.number[0][2] = 2 tp.number[0][3] = 3 tp.number[0][4] = 5 tp.number[0][5] = 6 tp.number[0][6] = 7 tp.number[1] = { } tp.number[1][1] = 8 tp.number[1][2] = 9 tp.number[2] = { } tp.number[2][1] = 1 tp.number[2][2] = 3 tp.number[2][3] = 4 tp.number[2][4] = 5 tp.number[2][5] = 7 tp.number[3] = { } tp.number[3][1] = 1 tp.number[3][2] = 3 tp.number[3][3] = 4 tp.number[3][4] = 6 tp.number[3][5] = 7 tp.number[4] = { } tp.number[4][1] = 2 tp.number[4][2] = 3 tp.number[4][3] = 4 tp.number[4][4] = 6 tp.number[5] = { } tp.number[5][1] = 1 tp.number[5][2] = 2 tp.number[5][3] = 4 tp.number[5][4] = 6 tp.number[5][5] = 7 tp.number[6] = { } tp.number[6][1] = 2 tp.number[6][2] = 4 tp.number[6][3] = 5 tp.number[6][4] = 6 tp.number[6][5] = 7 tp.number[7] = { } tp.number[7][1] = 1 tp.number[7][2] = 3 tp.number[7][3] = 6 tp.number[8] = { } tp.number[8][1] = 1 tp.number[8][2] = 2 tp.number[8][3] = 3 tp.number[8][4] = 4 tp.number[8][5] = 5 tp.number[8][6] = 6 tp.number[8][7] = 7 tp.number[9] = { } tp.number[9][1] = 1 tp.number[9][2] = 2 tp.number[9][3] = 3 tp.number[9][4] = 4 tp.number[9][5] = 6 tp.letter = { } tp.letter["a"] = { } tp.letter.a[1] = 1 tp.letter.a[2] = 2 tp.letter.a[3] = 3 tp.letter.a[4] = 4 tp.letter.a[5] = 5 tp.letter.a[6] = 6 tp.letter.b = { } tp.letter.b[1] = 1 tp.letter.b[2] = 2 tp.letter.b[3] = 3 tp.letter.b[4] = 4 tp.letter.b[5] = 5 tp.letter.b[6] = 6 tp.letter.b[7] = 7 tp.letter.c = { } tp.letter.c[1] = 1 tp.letter.c[2] = 2 tp.letter.c[3] = 5 tp.letter.c[4] = 7 tp.letter["d"] = { } tp.letter.d[1] = 2 tp.letter.d[2] = 5 tp.letter.d[3] = 10 tp.letter.d[4] = 12 tp.letter["e"] = { } tp.letter.e[1] = 1 tp.letter.e[2] = 2 tp.letter.e[3] = 4 tp.letter.e[4] = 5 tp.letter.e[5] = 7 tp.letter["f"] = { } tp.letter.f[1] = 1 tp.letter.f[2] = 2 tp.letter.f[3] = 4 tp.letter.f[4] = 5 tp.letter.g = { } tp.letter.g[1] = 1 tp.letter.g[2] = 2 tp.letter.g[3] = 5 tp.letter.g[4] = 7 tp.letter.g[5] = 13 tp.letter.h = { } tp.letter.h[1] = 2 tp.letter.h[2] = 3 tp.letter.h[3] = 4 tp.letter.h[4] = 5 tp.letter.h[5] = 6 tp.letter["i"] = { } tp.letter.i[1] = 8 tp.letter.i[2] = 9 tp.letter.j = { } tp.letter.j[1] = 1 tp.letter.j[2] = 8 tp.letter.j[3] = 10 tp.letter.j[4] = 5 tp.letter.k = { } tp.letter.k[1] = 8 tp.letter.k[2] = 9 tp.letter.k[3] = 11 tp.letter.k[4] = 13 tp.letter["l"] = { } tp.letter.l[1] = 2 tp.letter.l[2] = 5 tp.letter.l[3] = 7 tp.letter.m = { } tp.letter.m[1] = 2 tp.letter.m[2] = 3 tp.letter.m[3] = 5 tp.letter.m[4] = 6 tp.letter.m[5] = 12 tp.letter.m[6] = 11 tp.letter["n"] = { } tp.letter.n[1] = 2 tp.letter.n[2] = 3 tp.letter.n[3] = 5 tp.letter.n[4] = 6 tp.letter.n[5] = 12 tp.letter.n[6] = 13 tp.letter["o"] = { } tp.letter.o[1] = 1 tp.letter.o[2] = 2 tp.letter.o[3] = 3 tp.letter.o[4] = 5 tp.letter.o[5] = 6 tp.letter.o[6] = 7 tp.letter.p = { } tp.letter.p[1] = 1 tp.letter.p[2] = 2 tp.letter.p[3] = 3 tp.letter.p[4] = 4 tp.letter.p[5] = 5 tp.letter.q = { } tp.letter.q[1] = 1 tp.letter.q[2] = 2 tp.letter.q[3] = 3 tp.letter.q[4] = 5 tp.letter.q[5] = 6 tp.letter.q[6] = 7 tp.letter.q[7] = 13 tp.letter["r"] = { } tp.letter.r[1] = 1 tp.letter.r[2] = 2 tp.letter.r[3] = 3 tp.letter.r[4] = 4 tp.letter.r[5] = 5 tp.letter.r[6] = 13 tp.letter.s = { } tp.letter.s[1] = 1 tp.letter.s[2] = 12 tp.letter.s[3] = 13 tp.letter.s[4] = 7 tp.letter["t"] = { } tp.letter.t[1] = 1 tp.letter.t[2] = 8 tp.letter.t[3] = 9 tp.letter["u"] = { } tp.letter.u[1] = 2 tp.letter.u[2] = 3 tp.letter.u[3] = 5 tp.letter.u[4] = 6 tp.letter.u[5] = 7 tp.letter.v = { } tp.letter.v[1] = 2 tp.letter.v[2] = 5 tp.letter.v[3] = 10 tp.letter.v[4] = 11 tp.letter["w"] = { } tp.letter.w[1] = 2 tp.letter.w[2] = 3 tp.letter.w[3] = 5 tp.letter.w[4] = 6 tp.letter.w[5] = 10 tp.letter.w[6] = 13 tp.letter.x = { } tp.letter.x[1] = 10 tp.letter.x[2] = 11 tp.letter.x[3] = 12 tp.letter.x[4] = 13 tp.letter.y = { } tp.letter.y[1] = 9 tp.letter.y[2] = 11 tp.letter.y[3] = 12 tp.letter.z = { } tp.letter.z[1] = 1 tp.letter.z[2] = 7 tp.letter.z[3] = 10 tp.letter.z[4] = 11 tp.window_offset = { } tp.window_offset[1] = { } tp.window_offset[1].x = 198 tp.window_offset[1].y = 211 tp.window_offset[2] = { } tp.window_offset[2].x = 214 tp.window_offset[2].y = 211 tp.window_offset[3] = { } tp.window_offset[3].x = 320 tp.window_offset[3].y = 256 tp.window_offset[4] = { } tp.window_offset[4].x = 336 tp.window_offset[4].y = 256 tp.window_offset[5] = { } tp.window_offset[5].x = 352 tp.window_offset[5].y = 256 tp.window_offset[6] = { } tp.window_offset[6].x = 453 tp.window_offset[6].y = 211 tp.window_offset[7] = { } tp.window_offset[7].x = 469 tp.window_offset[7].y = 211 tp.daystr = { } tp.daystr[1] = "/tptx189/" tp.daystr[2] = "/tptx190/" tp.daystr[3] = "/tptx191/" tp.daystr[4] = "/tptx192/" tp.daystr[5] = "/tptx193/" tp.daystr[6] = "/tptx194/" tp.daystr[7] = "/tptx195/" end tp.enter = function(arg1) -- line 613 NewObjectState(tp_tckcu, OBJSTATE_OVERLAY, "print_ticket.bm") tp.stub:set_object_state("tp_stub.cos") tp.init_number_tables() if not mannys_hands then mannys_hands = Actor:create(nil, nil, nil, "/sytx188/") end mannys_hands:set_costume("tp_interface.cos") mannys_hands:put_in_set(tp) mannys_hands:moveto(-0.029, 0.002, 0) mannys_hands:setrot(0, 180, 0) tp.current_button = tp.RACE tp.text_color_bright = MakeColor(255, 150, 0) tp.text_color_dim = MakeColor(80, 80, 0) week_field = Led:create("week") week_field:add_digit(tp.window_offset[1].x, tp.window_offset[1].y) week_field:add_digit(tp.window_offset[2].x, tp.window_offset[2].y) week_field:display_number(1) tp.week = 1 cn.ticket.week = 1 day_field = Led:create("day") day_field:add_digit(tp.window_offset[3].x, tp.window_offset[3].y) day_field:add_digit(tp.window_offset[4].x, tp.window_offset[4].y) day_field:add_digit(tp.window_offset[5].x, tp.window_offset[5].y) day_field:display_str(tp.daystr[1]) tp.day = 1 cn.ticket.day = 1 race_field = Led:create("race") race_field:add_digit(tp.window_offset[6].x, tp.window_offset[6].y) race_field:add_digit(tp.window_offset[7].x, tp.window_offset[7].y) race_field:display_number(1) tp.race = 1 cn.ticket.race = 1 end tp.exit = function(arg1) -- line 656 mannys_hands:free() week_field:destroy() race_field:destroy() day_field:destroy() end tp.switch_to_set = function(arg1) -- line 664 if IsMoviePlaying() then StopMovie() else system.loopingMovie = nil end system.lastSet = system.currentSet LockSet(system.currentSet.setFile) inventory_save_set = system.currentSet arg1:CommonEnter() MakeCurrentSet(arg1.setFile) arg1:enter() system.currentSet = tp if system.ambientLight then SetAmbientLight(system.ambientLight) end end tp.return_to_set = function(arg1, arg2) -- line 685 START_CUT_SCENE() if arg2 then tp.stub:play_chore(0) tp.stub:wait_for_chore() end END_CUT_SCENE() tp:exit() system.currentSet = inventory_save_set UnLockSet(inventory_save_set.setFile) MakeCurrentSet(inventory_save_set.setFile) system.buttonHandler = inventory_save_handler if system.loopingMovie and type(system.loopingMovie) == "table" then play_movie_looping(system.loopingMovie.name, system.loopingMovie.x, system.loopingMovie.y) end if arg2 then START_CUT_SCENE() put_away_held_item() shrinkBoxesEnabled = FALSE open_inventory(TRUE, TRUE) manny.is_holding = cn.ticket start_script(close_inventory) if GlobalShrinkEnabled then shrinkBoxesEnabled = TRUE shrink_box_toggle() end END_CUT_SCENE() end end tpButtonHandler = function(arg1, arg2, arg3) -- line 724 shiftKeyDown = GetControlState(LSHIFTKEY) or GetControlState(RSHIFTKEY) altKeyDown = GetControlState(LALTKEY) or GetControlState(RALTKEY) controlKeyDown = GetControlState(LCONTROLKEY) or GetControlState(RCONTROLKEY) if control_map.OVERRIDE[arg1] and arg2 then single_start_script(tp.close_printer) elseif control_map.TURN_RIGHT[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(tp.move_right) elseif control_map.TURN_LEFT[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(tp.move_left) elseif control_map.LOOK_AT[arg1] and arg2 and cutSceneLevel <= 0 or (control_map.USE[arg1] and arg2 and cutSceneLevel <= 0) then single_start_script(cn.printer.lookAt, cn.printer) elseif control_map.MOVE_BACKWARD[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(tp.push_down) elseif control_map.MOVE_FORWARD[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(tp.push_up) else CommonButtonHandler(arg1, arg2, arg3) end end tp.move_left = function() -- line 747 local local1 while get_generic_control_state("TURN_LEFT") do if tp.current_button == tp.RACE then tp.current_button = tp.DAY mannys_hands:moveto(-0.015, 0.0020000001, 0) elseif tp.current_button == tp.DAY then tp.current_button = tp.WEEK mannys_hands:moveto(-0.001, 0.0020000001, 0) elseif tp.current_button == tp.WEEK then tp.current_button = tp.PRINT mannys_hands:moveto(-0.015, -0.02, 0) elseif tp.current_button == tp.PRINT then tp.current_button = tp.RACE mannys_hands:moveto(-0.028999999, 0.0020000001, 0) end mannys_hands:wait_for_actor() local1 = 0 while local1 < 500 and get_generic_control_state("TURN_LEFT") do break_here() local1 = local1 + system.frameTime end end end tp.move_right = function() -- line 777 local local1 while get_generic_control_state("TURN_RIGHT") do if tp.current_button == tp.WEEK then tp.current_button = tp.DAY mannys_hands:moveto(-0.015, 0.0020000001, 0) elseif tp.current_button == tp.DAY then tp.current_button = tp.RACE mannys_hands:moveto(-0.028999999, 0.0020000001, 0) elseif tp.current_button == tp.RACE then tp.current_button = tp.PRINT mannys_hands:moveto(-0.015, -0.02, 0) elseif tp.current_button == tp.PRINT then tp.current_button = tp.WEEK mannys_hands:moveto(-0.001, 0.0020000001, 0) end mannys_hands:wait_for_actor() local1 = 0 while local1 < 500 and get_generic_control_state("TURN_RIGHT") do break_here() local1 = local1 + system.frameTime end end end tp.close_printer = function() -- line 807 tp.return_to_set() end tp.push_up = function() -- line 811 START_CUT_SCENE() mannys_hands:play_chore(tp_interface_press_up) sleep_for(100) if tp.current_button == tp.RACE then tp.race = tp.race + 1 if tp.race > 15 then tp.race = 1 end cn.ticket.race = tp.race start_sfx("prntBtn1.wav", 100, 80) race_field:display_number(tp.race) elseif tp.current_button == tp.DAY then tp.day = tp.day + 1 if tp.day > 7 then tp.day = 1 end cn.ticket.day = tp.day start_sfx("prntBtn2.wav", 100, 80) day_field:display_str(tp.daystr[tp.day]) elseif tp.current_button == tp.WEEK then tp.week = tp.week + 1 if tp.week > 32 then tp.week = 1 end cn.ticket.week = tp.week start_sfx("prntBtn3.wav", 100, 80) week_field:display_number(tp.week) elseif tp.current_button == tp.PRINT then start_sfx("prntPrnt.wav") cn.ticket:get() tp:return_to_set(TRUE) end mannys_hands:wait_for_chore() END_CUT_SCENE() end tp.push_down = function() -- line 853 START_CUT_SCENE() if tp.current_button == tp.PRINT then mannys_hands:play_chore(tp_interface_press_up) else mannys_hands:play_chore(tp_interface_press_down) end sleep_for(100) if tp.current_button == tp.RACE then tp.race = tp.race - 1 if tp.race < 1 then tp.race = 15 end cn.ticket.race = tp.race start_sfx("prntBtn1.wav", 100, 80) race_field:display_number(tp.race) elseif tp.current_button == tp.DAY then tp.day = tp.day - 1 if tp.day < 1 then tp.day = 7 end cn.ticket.day = tp.day start_sfx("prntBtn2.wav", 100, 80) day_field:display_str(tp.daystr[tp.day]) elseif tp.current_button == tp.WEEK then tp.week = tp.week - 1 if tp.week < 1 then tp.week = 32 end cn.ticket.week = tp.week start_sfx("prntBtn3.wav", 100, 80) week_field:display_number(tp.week) elseif tp.current_button == tp.PRINT then start_sfx("prntPrnt.wav") cn.ticket:get() tp:return_to_set(TRUE) end mannys_hands:wait_for_chore() END_CUT_SCENE() end tp.stub = Object:create(tp, "", 0, 0, 0, { range = 0 }) CheckFirstTime("th.lua") dofile("thunderboy1_idles.lua") dofile("thunderboy2_idles.lua") dofile("thb1_coffee.lua") dofile("thb2_coffee.lua") dofile("msb_snowblow.lua") dofile("msb_coffee.lua") dofile("msb_theater.lua") th = Set:create("th.set", "theater backstage", { th_stgws = 0, th_stgws2 = 0, th_rftha = 2, th_tbyws = 1, th_snocu = 3, th_ovrhd = 4 }) th.lever_actor = Actor:create(nil, nil, nil, "snow lever") th.lever_actor.default = function(arg1) -- line 24 arg1:set_costume("msb_snowblow.cos") arg1:put_in_set(th) arg1:setpos(0.20997, -0.0325, 2.1527) arg1:setrot(0, 90, 0) arg1:play_chore(msb_snowblow_chain_only) end th.coffeepot_actor = Actor:create(nil, nil, nil, "coffee pot") th.coffeepot_actor.default = function(arg1) -- line 35 arg1:set_costume("msb_coffee.cos") arg1:put_in_set(th) arg1:set_softimage_pos(-4.4588, 0, 19.993) arg1:setrot(0, 225, 0) arg1:play_chore(msb_coffee_coffee_on_burner) arg1:set_visibility(TRUE) end th.grinder_actor = Actor:create(nil, nil, nil, "grinder") th.grinder_actor.default = function(arg1) -- line 47 arg1:set_costume("th_grinder.cos") arg1:put_in_set(th) arg1:setpos(0.0860798, -0.011, 2.497) arg1:setrot(0, 101, 0) if th.grinder.has_bone then arg1:complete_chore(1) else arg1:complete_chore(0) end end th.stop_thunderboys = function() -- line 61 stop_script(th.backstage_mumbling) stop_script(th.backstage_idling) thunder_boy_1:stop_chore(thunderboy1_idles_mumble, "thunderboy1_idles.cos") thunder_boy_1:play_chore(thunderboy1_idles_stop_talk, "thunderboy1_idles.cos") thunder_boy_2:stop_chore(thunderboy2_idles_mumble, "thunderboy2_idles.cos") thunder_boy_2:play_chore(thunderboy2_idles_stop_talk, "thunderboy2_idles.cos") end tb1 = Dialog:create() tb1.intro = function(arg1) -- line 72 th.mocked = TRUE if find_script(th.meet_the_thunder_boys) then stop_script(th.meet_the_thunder_boys) end th.stop_thunderboys() wait_for_message() START_CUT_SCENE() manny:setpos(0.363558, -0.583726, 0) manny:setrot(0, 296.391, 0) thunder_boy_1:say_line("/tht1003/") thunder_boy_1:wait_for_message() END_CUT_SCENE() end tb1[100] = { text = "/thma004/", n1 = TRUE } tb1[100].response = function(arg1) -- line 90 thunder_boy_2:say_line("/tht2005/") manny:head_look_at(th.thunderboy2) tb1.kiss_off() end tb1[200] = { text = "/thma006/", n1 = TRUE } tb1[200].response = function(arg1) -- line 97 thunder_boy_2:say_line("/tht2007/") manny:head_look_at(th.thunderboy2) tb1.kiss_off() end tb1.kiss_off = function() -- line 104 tb1.node = "exit_dialog" wait_for_message() thunder_boy_1:say_line("/tht1008/") manny:head_look_at(th.thunderboy1) wait_for_message() thunder_boy_2:say_line("/tht2009/") manny:head_look_at(th.thunderboy2) wait_for_message() manny:head_look_at(nil) manny:walkto(0.197732, -0.593037, 0) th:current_setup(th_stgws) sleep_for(1000) thunder_boy_2:say_line("/tht2010/") sleep_for(500) thunder_boy_1:say_line("/tht1011/") wait_for_message() start_script(th.backstage_mumbling, th) start_script(th.backstage_idling, th) cameraman_disabled = FALSE end th.back_off = function() -- line 126 stop_script(th.meet_the_thunder_boys) if manny.is_holding == th.coffee_pot then start_script(th.serve_coffee) else cameraman_disabled = TRUE th:current_setup(th_tbyws) manny:setpos(0.363558, -0.583726, 0) manny:setrot(0, 296.391, 0) if th.mocked then START_CUT_SCENE() thunder_boy_2:say_line("/tht2012/") wait_for_message() thunder_boy_2:say_line("/tht2013/") END_CUT_SCENE() manny:setpos(0.197732, -0.593037, 0) manny:setrot(0, 108.182, 0) th:current_setup(th_stgws) cameraman_disabled = FALSE else tb1:init() end end end th.meet_the_thunder_boys = function() -- line 155 START_CUT_SCENE() th.met_thunder_boys = TRUE set_override(th.skip_meet_boys, th) manny:head_look_at(th.thunderboy2) stop_script(th.backstage_mumbling) thunder_boy_1:stop_chore(thunderboy1_idles_mumble, "thunderboy1_idles.cos") thunder_boy_1:play_chore(thunderboy1_idles_stop_talk, "thunderboy1_idles.cos") thunder_boy_2:stop_chore(thunderboy2_idles_mumble, "thunderboy2_idles.cos") thunder_boy_2:play_chore(thunderboy2_idles_stop_talk, "thunderboy2_idles.cos") thunder_boy_2:say_line("/tht2014/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1015/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2016/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1017/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2018/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1019/") thunder_boy_1:wait_for_message() END_CUT_SCENE() manny:head_look_at(nil) thunder_boy_2:say_line("/tht2020/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1021/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2022/") thunder_boy_2:wait_for_message() thunder_boy_2:say_line("/tht2023/") thunder_boy_2:wait_for_message() start_script(th.backstage_mumbling, th) end th.skip_meet_boys = function(arg1) -- line 193 kill_override() single_start_script(th.backstage_mumbling, th) end th.eavesdrop = function() -- line 199 th.stop_thunderboys() START_CUT_SCENE() box_off("eavesdrop_trigg") th.eavesdropped = TRUE th:current_setup(th_tbyws) break_here() thunder_boy_2:say_line("/tht2024/") sleep_for(500) manny:walkto(0.960463, -1.08513, -0.29) manny:wait_for_actor() manny:setrot(0, 452.177, 0) thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1025/") wait_for_message() thunder_boy_2:say_line("/tht2026/") wait_for_message() thunder_boy_2:say_line("/tht2027/") wait_for_message() thunder_boy_1:say_line("/tht1028/") wait_for_message() th:current_setup(th_stgws) END_CUT_SCENE() single_start_script(th.backstage_mumbling, th) single_start_script(th.backstage_idling, th) end th.burn_thunderboy_burn = function() -- line 227 START_CUT_SCENE() th.boys_gone = TRUE th.thunderboy1:make_untouchable() th.thunderboy2:make_untouchable() stop_script(th.meet_the_thunder_boys) th.stop_thunderboys() th.thunderboys_from_above:make_untouchable() box_off("personal_bubble") box_off("eavesdrop_trigg") thunder_boy_1:wait_for_chore() thunder_boy_2:wait_for_chore() manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(msb_activate_coffeepot, manny.base_costume) manny:push_costume("msb_coffee.cos") manny:play_chore(msb_coffee_start_pour_on_boyz, "msb_coffee.cos") sleep_for(100) start_sfx("thCofLng.WAV") manny:wait_for_chore(msb_coffee_start_pour_on_boyz, "msb_coffee.cos") manny:play_chore_looping(msb_coffee_pour_on_boyz, "msb_coffee.cos") music_state:set_sequence(seqCoffeeOnBoys) sleep_for(1000) th:current_setup(th_tbyws) manny:ignore_boxes() manny:setpos(0.542084, -0.123266, 2.05) manny:setrot(0, 164.794, 0) thunder_boy_2:say_line("/tht2029/") sleep_for(500) thunder_boy_1:stop_chore(thunderboy1_idles_talk1, "thunderboy1_idles.cos") thunder_boy_1:stop_chore(thunderboy1_idles_talk2, "thunderboy1_idles.cos") thunder_boy_1:stop_chore(thunderboy1_idles_whole_back, "thunderboy1_idles.cos") thunder_boy_1:set_time_scale(1.2) thunder_boy_1:play_chore(thb1_coffee_coffee_dumped, "thb1_coffee.cos") thunder_boy_2:stop_chore(thunderboy2_idles_talk1, "thunderboy2_idles.cos") thunder_boy_2:stop_chore(thunderboy2_idles_talk2, "thunderboy2_idles.cos") thunder_boy_2:stop_chore(thunderboy2_idles_whole_back, "thunderboy2_idles.cos") thunder_boy_2:set_time_scale(1.2) thunder_boy_2:play_chore(thb2_coffee_dumped_on, "thb2_coffee.cos") thunder_boy_2:wait_for_message() manny:stop_chore(msb_coffee_pour_on_boyz, "msb_coffee.cos") thunder_boy_2:say_line("/tht2030/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1031/") thunder_boy_1:wait_for_message() sleep_for(1000) thunder_boy_2:say_line("/tht2032/") thunder_boy_2:wait_for_message() th:current_setup(th_stgws) thunder_boy_2:setpos(0.625962, -0.313716, 0) thunder_boy_2:setrot(0, 123.538, 0) thunder_boy_2:setpos(0.605883, -0.492313, 0) thunder_boy_1:setrot(0, 63.5565, 0) thunder_boy_2:say_line("/tht2033/") thunder_boy_2:wait_for_message() thunder_boy_2:say_line("/tht2034/") thunder_boy_2:wait_for_chore(thb2_coffee_dumped_on, "thb2_coffee.cos") thunder_boy_2:play_chore(thb2_coffee_run, "thb2_coffee.cos") thunder_boy_1:play_chore(thb1_coffee_run, "thb1_coffee.cos") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1035/") thunder_boy_1:wait_for_chore(thb1_coffee_run, "thb1_coffee.cos") th:current_setup(th_rftha) manny:follow_boxes() manny:put_at_object(th.thunderboys_from_above) manny:play_chore(msb_coffee_stop_pour_on_boyz, "msb_coffee.cos") manny:wait_for_chore(msb_coffee_stop_pour_on_boyz, "msb_coffee.cos") thunder_boy_1:wait_for_message() thunder_boy_1:free() thunder_boy_2:free() manny:pop_costume() manny:play_chore(msb_hold, manny.base_costume) manny:play_chore(msb_activate_coffeepot, manny.base_costume) END_CUT_SCENE() end th.set_up_actors = function(arg1) -- line 312 if th.boys_gone then thunder_boy_1:put_in_set(nil) th.thunderboy1:make_untouchable() thunder_boy_2:put_in_set(nil) th.thunderboy2:make_untouchable() box_off("personal_bubble") box_off("eavesdrop_trigg") else thunder_boy_1:default() thunder_boy_1:put_in_set(th) thunder_boy_1:setpos(0.63103, -0.69655, 0) thunder_boy_1:setrot(0, 95.2081, 0) thunder_boy_2:default() thunder_boy_2:put_in_set(th) thunder_boy_2:setpos(0.60327, -0.35421, 0) thunder_boy_2:setrot(0, 144.486, 0) start_script(th.backstage_mumbling, th) start_script(th.backstage_idling, th) end th.lever_actor:default() if th.coffee_pot.touchable then th.coffeepot_actor:default() end if th.snow_machine.has_grinder then th.grinder_actor:default() end if makeup_woman then makeup_woman.saylineTable.x = 400 makeup_woman.saylineTable.y = 200 makeup_woman.saylineTable.pan = 110 end end th.backstage_lines_one = { "/tht1044/", "/tht1045/", "/tht1046/", "/tht1047/", "/tht1048/", "/tht1049/", "/tht1050/", "/tht1051/", "/tht1052/" } th.backstage_lines_two = { "/tht2036/", "/tht2037/", "/tht2038/", "/tht2039/", "/tht2040/", "/tht2041/", "/tht2042/", "/tht2043/" } th.backstage_mumbling = function(arg1) -- line 375 local local1 = thunder_boy_1 local local2 = th.backstage_lines_one local local3, local4, local5 while system.currentSet == th do if cutSceneLevel <= 0 then if local1 == thunder_boy_1 then local1:play_chore_looping(thunderboy1_idles_mumble, "thunderboy1_idles.cos") else local1:play_chore_looping(thunderboy2_idles_mumble, "thunderboy2_idles.cos") end local3 = rndint(2000, 5000) local5 = FALSE local4 = 0 while local4 < local3 do if not local5 and rnd(8) and cutSceneLevel <= 0 then if local1 == thunder_boy_1 then local1:stop_chore(thunderboy1_idles_mumble, "thunderboy1_idles.cos") else local1:stop_chore(thunderboy2_idles_mumble, "thunderboy2_idles.cos") end local1:say_line(pick_one_of(local2, TRUE), { background = TRUE, skip_log = TRUE, volume = 10 }) local1:wait_for_message() if local1 == thunder_boy_1 then local1:play_chore_looping(thunderboy1_idles_mumble, "thunderboy1_idles.cos") else local1:play_chore_looping(thunderboy2_idles_mumble, "thunderboy2_idles.cos") end local5 = TRUE end break_here() local4 = local4 + system.frameTime end if local1 == thunder_boy_1 then local1:stop_chore(thunderboy1_idles_mumble, "thunderboy1_idles.cos") local1:play_chore(thunderboy1_idles_stop_talk, "thunderboy1_idles.cos") local1 = thunder_boy_2 local2 = th.backstage_lines_two else local1:stop_chore(thunderboy2_idles_mumble, "thunderboy2_idles.cos") local1:play_chore(thunderboy2_idles_stop_talk, "thunderboy2_idles.cos") local1 = thunder_boy_1 local2 = th.backstage_lines_one end end break_here() end end th.backstage_idling = function(arg1) -- line 427 local local1, local2 thunder_boy_1:play_chore(thunderboy1_idles_whole_back, "thunderboy1_idles.cos") thunder_boy_2:play_chore(thunderboy1_idles_whole_back, "thunderboy2_idles.cos") thunder_boy_1:wait_for_chore(thunderboy1_idles_whole_back, "thunderboy1_idles.cos") thunder_boy_2:wait_for_chore(thunderboy1_idles_whole_back, "thunderboy2_idles.cos") while system.currentSet == th do if local1 == thunderboy1_idles_talk1 then local1 = thunderboy1_idles_talk2 else local1 = thunderboy1_idles_talk1 end thunder_boy_1:play_chore(local1, "thunderboy1_idles.cos") thunder_boy_1:wait_for_chore(local1, "thunderboy1_idles.cos") if local2 == thunderboy2_idles_talk1 then local2 = thunderboy2_idles_talk2 else local2 = thunderboy2_idles_talk1 end thunder_boy_2:play_chore(local2, "thunderboy2_idles.cos") thunder_boy_2:wait_for_chore(local2, "thunderboy2_idles.cos") end end th.crash_dressing_room = function() -- line 456 START_CUT_SCENE() if manny.is_holding == th.coffee_pot and (not th.boys_gone or manny.thunder) then makeup_woman:say_line("/thmk053/") makeup_woman:wait_for_message() start_sfx("thCofSht.WAV", IM_HIGH_PRIORITY, 127) set_pan("thCofSht.WAV", 127) wait_for_sound("thCofSht.WAV") elseif not th.boys_gone then makeup_woman:say_line("/thmk054/") elseif not manny.thunder then manny.thunder = TRUE cur_puzzle_state[55] = TRUE if manny.is_holding == th.coffee_pot then th.coffee_pot:free() th.coffee_pot:make_untouchable() box_on("grinder_box1") box_on("grinder_box2") manny.is_holding = nil manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(msb_activate_coffeepot, manny.base_costume) makeup_woman:say_line("/thmk056/") else makeup_woman:say_line("/thmk057/") end wait_for_message() makeup_woman:say_line("/thmk058/") wait_for_message() manny:say_line("/thma059/") wait_for_message() IrisDown(570, 300, 1000) makeup_woman:say_line("/thmk060/") wait_for_message() sleep_for(500) manny.thunder = TRUE manny:default("thunder") IrisUp(570, 300, 1000) manny:walkto(1.06713, -1.14721, -0.29) makeup_woman:say_line("/thmk061/") else manny:say_line("/thma062/") wait_for_message() makeup_woman:say_line("/thmk063/") wait_for_message() if not th.bashed_thunder then th.bashed_thunder = TRUE makeup_woman:say_line("/thmk064/") wait_for_message() manny:say_line("/thma065/") wait_for_message() makeup_woman:say_line("/thmk066/") end end END_CUT_SCENE() manny:walkto(1.06713, -1.14721, -0.29) end th.serve_coffee = function() -- line 519 th:current_setup(th_stgws) th.stop_thunderboys() START_CUT_SCENE() set_override(th.skip_serve_coffee, th) thunder_boy_1:say_line("/tht1067/") manny:head_look_at(th.thunderboy1) manny:walkto(0.156781, -0.804922, 0, 0, 296.215, 0) thunder_boy_1:wait_for_message() manny:wait_for_actor() thunder_boy_1:wait_for_chore() thunder_boy_1:set_time_scale(1.8) thunder_boy_2:set_time_scale(1.8) manny:push_costume("msb_coffee.cos") thunder_boy_1:play_chore(thb1_coffee_get_coffee, "thb1_coffee.cos") sleep_for(1500) manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(msb_activate_coffeepot, manny.base_costume) manny:play_chore(msb_coffee_2coffee_pour, "msb_coffee.cos") sleep_for(100) start_sfx("thCofSht.WAV") manny:wait_for_chore(msb_coffee_2coffee_pour, "msb_coffee.cos") manny:play_chore(msb_coffee_stop_pour, "msb_coffee.cos") manny:wait_for_chore(msb_coffee_stop_pour, "msb_coffee.cos") manny:pop_costume() manny:play_chore(msb_hold, manny.base_costume) manny:play_chore(msb_activate_coffeepot, manny.base_costume) manny:head_look_at(th.thunderboy2) manny:walkto(0.126085, -0.476472, 0, 0, 317.476, 0) manny:wait_for_actor() thunder_boy_2:wait_for_chore() manny:push_costume("msb_coffee.cos") thunder_boy_2:play_chore(thb2_coffee_get_coffee, "thb2_coffee.cos") sleep_for(1500) manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(msb_activate_coffeepot, manny.base_costume) manny:play_chore(msb_coffee_2coffee_pour, "msb_coffee.cos") sleep_for(100) start_sfx("thCofSht.WAV") manny:wait_for_chore(msb_coffee_2coffee_pour, "msb_coffee.cos") manny:play_chore(msb_coffee_stop_pour, "msb_coffee.cos") manny:wait_for_chore(msb_coffee_stop_pour, "msb_coffee.cos") manny:pop_costume() manny:play_chore(msb_hold, manny.base_costume) manny:play_chore(msb_activate_coffeepot, manny.base_costume) thunder_boy_1:set_time_scale(1) thunder_boy_2:set_time_scale(1) if not th.served then th.served = TRUE thunder_boy_2:say_line("/tht2068/") thunder_boy_2:wait_for_message() thunder_boy_2:say_line("/tht2069/") thunder_boy_2:wait_for_message() else thunder_boy_2:say_line("/tht2070/") thunder_boy_2:wait_for_message() end END_CUT_SCENE() single_start_script(th.backstage_mumbling, th) single_start_script(th.backstage_idling, th) end th.skip_serve_coffee = function(arg1) -- line 587 kill_override() if manny:get_costume() == "msb_coffee.cos" then manny:pop_costume() end thunder_boy_1:stop_chore() thunder_boy_2:stop_chore() thunder_boy_1:set_time_scale(1) thunder_boy_2:set_time_scale(1) manny:play_chore(msb_hold, manny.base_costume) manny:play_chore(msb_activate_coffeepot, manny.base_costume) manny:setpos(0.126085, -0.476472, 0) manny:setrot(0, 317.476, 0) single_start_script(th.backstage_mumbling, th) single_start_script(th.backstage_idling, th) end th.climb_in = function(arg1) -- line 604 local local1 START_CUT_SCENE() th:switch_to_set() manny:put_in_set(th) manny:setpos(-0.53868401, -1.2299401, 0) manny:setrot(0, 78.479599, 0) if manny.fancy then local1 = "mcc_theater.cos" else local1 = "msb_theater.cos" end manny:push_costume(local1) manny:play_chore(msb_theater_enter_th, local1) manny:wait_for_chore(msb_theater_enter_th, local1) manny:blend(msb_rest, msb_theater_enter_th, 500, manny.base_costume, local1) sleep_for(500) manny:pop_costume() manny:walkto(-0.37628499, -1.23063, 0, 0, 285.67001, 0) END_CUT_SCENE() end th.climb_out = function(arg1) -- line 627 local local1 START_CUT_SCENE() manny:walkto(-0.53868401, -1.2299401, 0, 0, 78.479599, 0) manny:wait_for_actor() if manny.fancy then local1 = "mcc_theater.cos" else local1 = "msb_theater.cos" end manny:push_costume(local1) manny:fade_in_chore(msb_theater_exit_th, local1, 500) manny:wait_for_chore(msb_theater_exit_th, local1) manny:pop_costume() END_CUT_SCENE() end th.enter = function(arg1) -- line 651 th:set_up_actors() if th.eavesdropped then box_off("eavesdrop_trigg") end end th.exit = function(arg1) -- line 658 th.lever_actor:free() th.coffeepot_actor:free() thunder_boy_1:free() thunder_boy_2:free() stop_script(th.meet_the_thunder_boys) stop_script(th.backstage_mumbling) stop_script(th.backstage_idling) end th.personal_bubble = { } th.personal_bubble.walkOut = function(arg1) -- line 677 start_script(th.back_off) end th.eavesdrop_trigg = { } th.eavesdrop_trigg.walkOut = function(arg1) -- line 684 start_script(th.eavesdrop) end th.grinder = Object:create(th, "/thtx071/grinder", 0, 0, 0, { range = 0 }) th.grinder.use_pnt_x = 0.175 th.grinder.use_pnt_y = -0.048978701 th.grinder.use_pnt_z = 2.2 th.grinder.use_rot_x = 0 th.grinder.use_rot_y = 89.391602 th.grinder.use_rot_z = 0 th.grinder.wav = "getMetl.wav" th.grinder:make_untouchable() th.grinder.lookAt = function(arg1) -- line 699 if manny.shot and not manny.healed then mf:use_grinder() elseif not arg1.has_bone then manny:say_line("/thma072/") else manny:say_line("/thma073/") end end th.grinder.use = function(arg1) -- line 711 local local1, local2, local3 if manny.shot and not manny.healed then mf:use_grinder() elseif arg1.has_bone and bowlsley_in_hiding then manny_grind() else START_CUT_SCENE() look_at_item_in_hand(TRUE) if arg1.has_bone or arg1.has_snow then if manny.costume_state == "reaper" then local1 = md_use_grinder local3 = md_activate_grinder_full local2 = md_hold_grinder start_sfx("grinder.IMU") manny:play_chore_looping(local1, manny.base_costume) sleep_for(2000) manny:head_look_at(nil) fade_sfx("grinder.imu", 500) if arg1.has_bone or arg1.has_snow then manny:stop_chore(local1, manny.base_costume) manny:play_chore(local2, manny.base_costume) manny:play_chore(local3, manny.base_costume) end elseif manny.fancy then manny:stop_chore(mcc_thunder_hold, "mcc_thunder.cos") if arg1.has_snow then manny:stop_chore(mcc_thunder_takeout_grinder_empty, "mcc_thunder.cos") manny:play_chore_looping(75, "mcc_thunder.cos") else manny:stop_chore(mcc_thunder_takeout_grinder_full, "mcc_thunder.cos") manny:play_chore_looping(mcc_thunder_use_grinder, "mcc_thunder.cos") end manny:play_chore_looping(mcc_thunder_hold_grinder, "mcc_thunder.cos") start_sfx("grinder.IMU") sleep_for(2000) manny:head_look_at(nil) fade_sfx("grinder.imu", 500) manny:stop_chore(mcc_thunder_use_grinder, "mcc_thunder.cos") manny:stop_chore(75, "mcc_thunder.cos") manny:stop_chore(mcc_thunder_hold_grinder, "mcc_thunder.cos") manny:play_chore_looping(mcc_thunder_hold, "mcc_thunder.cos") if arg1.has_snow then manny:play_chore_looping(mcc_thunder_takeout_grinder_empty, "mcc_thunder.cos") else manny:play_chore_looping(mcc_thunder_takeout_grinder_full, "mcc_thunder.cos") end else if th.grinder.has_bone then manny:stop_chore(msb_activate_grinder_full, manny.base_costume) else manny:stop_chore(msb_activate_grinder_empty, manny.base_costume) end if arg1.has_snow then local1 = 87 else local1 = msb_use_grinder end start_sfx("grinder.IMU") manny:play_chore_looping(local1, manny.base_costume) sleep_for(2000) manny:head_look_at(nil) fade_sfx("grinder.imu", 500) manny:stop_chore(local1, manny.base_costume) if th.grinder.has_bone then manny:play_chore_looping(msb_activate_grinder_full, manny.base_costume) else manny:play_chore_looping(msb_activate_grinder_empty, manny.base_costume) end end else start_sfx("grinder.IMU") sleep_for(2000) fade_sfx("grinder.imu", 500) end END_CUT_SCENE() if arg1.has_snow then arg1.has_snow = FALSE end end end th.grinder.default_response = th.grinder.use th.snow_machine = Object:create(th, "/thtx074/snow machine", 0.025, -0.0289787, 2.46, { range = 0.60000002 }) th.snow_machine.use_pnt_x = 0.175 th.snow_machine.use_pnt_y = -0.048978701 th.snow_machine.use_pnt_z = 2.2 th.snow_machine.use_rot_x = 0 th.snow_machine.use_rot_y = 89.391602 th.snow_machine.use_rot_z = 0 th.snow_machine.has_grinder = TRUE th.snow_machine.lookAt = function(arg1) -- line 811 arg1.seen = TRUE manny:say_line("/thma075/") if arg1.has_grinder and not th.held_grinder then arg1:demo() end end th.snow_machine.demo = function(arg1) -- line 819 START_CUT_SCENE() wait_for_message() manny:say_line("/thma076/") arg1:pickUp() manny:say_line("/moma053/") manny:wait_for_message() manny:setrot(0, 126.275, 0, TRUE) manny:wait_for_actor() manny:say_line("/syma159/") look_at_item_in_hand() arg1:use_grinder() END_CUT_SCENE() end th.snow_machine.pickUp = function(arg1) -- line 835 if arg1.has_grinder then th.held_grinder = TRUE if manny.is_holding == th.coffee_pot then system.default_response("not now") else START_CUT_SCENE() th:current_setup(th_snocu) manny:walkto(0.217875, -0.064783, 2.156, 0, -272.067, 0) manny:head_look_at(nil) arg1.has_grinder = FALSE arg1.seen = TRUE th.grinder:get() if manny.fancy then if th.grinder.has_bone then manny:play_chore(mcc_thunder_take_grinder_hand, "mcc_thunder.cos") else manny:play_chore(mcc_thunder_take_grinder_no_hand, "mcc_thunder.cos") end elseif th.grinder.has_bone then manny:play_chore(msb_take_grinder_hand, "msb.cos") else manny:play_chore(msb_take_grinder_no_hand, "msb.cos") end sleep_for(850) start_sfx("thInsGrn.WAV") th.grinder_actor:set_visibility(FALSE) sleep_for(900) start_sfx("grdClLid.wav") manny:wait_for_chore() if manny.fancy then manny:stop_chore(mcc_thunder_take_grinder_hand, "mcc_thunder.cos") manny:stop_chore(mcc_thunder_take_grinder_no_hand, "mcc_thunder.cos") else manny:stop_chore(msb_take_grinder_no_hand, "msb.cos") manny:stop_chore(msb_take_grinder_hand, "msb.cos") end if manny.fancy then if th.grinder.has_bone then manny:play_chore_looping(mcc_thunder_takeout_grinder_full, manny.base_costume) manny.hold_chore = mcc_thunder_takeout_grinder_full else manny:play_chore_looping(mcc_thunder_takeout_grinder_empty, manny.base_costume) manny.hold_chore = mcc_thunder_takeout_grinder_empty end elseif th.grinder.has_bone then manny:play_chore_looping(msb_activate_grinder_full, manny.base_costume) manny.hold_chore = msb_activate_grinder_full else manny:play_chore_looping(msb_activate_grinder_empty, manny.base_costume) manny.hold_chore = msb_activate_grinder_empty end manny:play_chore_looping(ms_hold, manny.base_costume) sleep_for(1000) manny.is_holding = th.grinder manny:head_look_at(arg1) END_CUT_SCENE() end else system.default_response("huge") end end th.snow_machine.use = function(arg1) -- line 902 if arg1.has_grinder then START_CUT_SCENE() manny:walkto(0.217875, -0.064783, 2.156, 0, 82.7267, 0) manny:wait_for_actor() th:current_setup(th_snocu) if manny.fancy then manny:push_costume("mcc_snowblow.cos") else manny:push_costume("msb_snowblow.cos") end manny:play_chore(msb_snowblow_turn_switch) sleep_for(600) start_sfx("snoMach.IMU") if th.grinder.has_snow or th.grinder.has_bone then th:current_setup(th_stgws) if not th.snow_actor then th.snow_actor = Actor:create(nil, nil, nil, "snow") end th.snow_actor:put_in_set(th) th.snow_actor:set_costume("th_snow.cos") th.snow_actor:set_softimage_pos(0, 2, 0) th.snow_actor:setrot(0, 180, 0) th.snow_actor:play_chore_looping(0) sleep_for(5000) th:current_setup(th_snocu) th.snow_actor:free() if th.grinder.has_snow then th.grinder.has_snow = FALSE end else sleep_for(2000) end stop_sound("snoMach.IMU") manny:wait_for_chore(msb_snowblow_turn_switch) manny:pop_costume() END_CUT_SCENE() if not arg1.seen then arg1:lookAt() end else manny:say_line("/thma077/") end end th.snow_machine.use_grinder = function(arg1) -- line 947 if th.grinder.has_bone then manny:say_line("/thma078/") else START_CUT_SCENE() manny:walkto(0.217875, -0.064783, 2.156, 0, 82.7267, 0) manny:wait_for_actor() th:current_setup(th_snocu) manny:head_look_at(nil) arg1.has_grinder = TRUE manny:stop_chore(msb_hold, manny.base_costume) if manny.fancy then manny:stop_chore(mcc_thunder_takeout_grinder_empty, "mcc_thunder.cos") manny:play_chore(mcc_thunder_return_grinder, "mcc_thunder.cos") else manny:stop_chore(msb_activate_grinder_empty, "msb.cos") manny:play_chore(msb_return_grinder, "msb.cos") end sleep_for(800) start_sfx("grdOpLid.wav") sleep_for(200) start_sfx("thInsGrn.WAV") sleep_for(374) th.grinder_actor:set_visibility(TRUE) manny:wait_for_chore() manny.hold_chore = nil manny.is_holding = nil if manny.fancy then manny:stop_chore(mcc_thunder_return_grinder, "mcc_thunder.cos") else manny:stop_chore(msb_return_grinder, "msb.cos") end th.grinder:free() sleep_for(200) manny:head_look_at(arg1) END_CUT_SCENE() end end th.snow_machine.use_hand = function(arg1) -- line 987 if arg1.has_grinder then if th.grinder.has_snow then system.default_response("full") else START_CUT_SCENE() manny:walkto(0.196374, -0.0406213, 2.2, 0, 82.7267, 0) manny:wait_for_actor() nq.arm:free() th.grinder.has_bone = TRUE manny:head_look_at(nil) manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(manny.hold_chore, manny.base_costume) manny.hold_chore = nil if manny.fancy then manny:push_costume("mcc_snowblow.cos") else manny:push_costume("msb_snowblow.cos") end manny:play_chore(msb_snowblow_put_hand) manny:wait_for_chore(msb_snowblow_put_hand) manny:pop_costume() th.grinder_actor:default() manny:head_look_at(arg1) manny:say_line("/thma079/") END_CUT_SCENE() end else th.snow_machine:use() end end th.snow_machine.use_coffee_pot = function(arg1) -- line 1019 manny:say_line("/thma080/") end th.snow_machine.use_sproutella = function(arg1) -- line 1023 if arg1.has_grinder and th.grinder.has_bone then manny:say_line("/thma081/") else fi.sproutella:default_response(th.snow_machine) end end th.lever = Object:create(th, "/thtx082/lever", 0.075000003, 0.151021, 2.5699999, { range = 0.60000002 }) th.lever.use_pnt_x = 0.20997 th.lever.use_pnt_y = -0.032499999 th.lever.use_pnt_z = 2.2 th.lever.use_rot_x = 0 th.lever.use_rot_y = 90 th.lever.use_rot_z = 0 th.lever.lookAt = function(arg1) -- line 1041 manny:say_line("/thma083/") end th.lever.use = function(arg1) -- line 1046 if th.snow_machine.has_grinder then if manny.is_holding == th.coffee_pot then system.default_response("not now") elseif th.grinder.has_snow or th.grinder.has_bone then system.default_response("full") else th.grinder.has_snow = TRUE if manny:walkto_object(arg1) then START_CUT_SCENE() manny:head_look_at(nil) if manny.fancy then manny:push_costume("mcc_snowblow.cos") else manny:push_costume("msb_snowblow.cos") end th.lever_actor:set_visibility(FALSE) manny:play_chore(msb_snowblow_pull_chain) manny:wait_for_chore(msb_snowblow_pull_chain) manny:pop_costume() th.lever_actor:set_visibility(TRUE) END_CUT_SCENE() end end else soft_script() manny:say_line("/thma084/") wait_for_message() manny:say_line("/thma085/") end end th.lever.pickUp = function(arg1) -- line 1080 if th.snow_machine.has_grinder then start_script(th.snow_machine.pickUp, th.snow_machine) else th.lever:use() end end th.ladder_bot = Object:create(th, "/thtx001/ladder", 0.70499998, -0.055, 0.75999999, { range = 1 }) th.ladder_bot.use_pnt_x = 0.46472499 th.ladder_bot.use_pnt_y = -0.040333699 th.ladder_bot.use_pnt_z = 0 th.ladder_bot.use_rot_x = 0 th.ladder_bot.use_rot_y = 258.875 th.ladder_bot.use_rot_z = 0 th.ladder_bot.lookAt = function(arg1) -- line 1099 system.default_response("ladder") end th.ladder_bot.pickUp = function(arg1) -- line 1103 system.default_response("attached") end th.ladder_bot.use = function(arg1) -- line 1107 if manny:walkto_object(arg1) then START_CUT_SCENE() manny:head_look_at(th.ladder_top) if not manny.fancy then manny:play_chore(msb_lf_hand_on_obj, manny.base_costume) manny:wait_for_chore(msb_lf_hand_on_obj, manny.base_costume) else manny:play_chore(mcc_thunder_lf_hand_on_obj, manny.base_costume) manny:wait_for_chore(mcc_thunder_lf_hand_on_obj, manny.base_costume) end manny:put_at_object(th.ladder_top) th:current_setup(th_rftha) manny:head_look_at(th.ladder_top) if not manny.fancy then manny:stop_chore(msb_lf_hand_on_obj, manny.base_costume) manny:play_chore(msb_end_crouch, manny.base_costume) manny:wait_for_chore(msb_end_crouch, manny.base_costume) manny:stop_chore(msb_end_crouch, manny.base_costume) else manny:stop_chore(mcc_thunder_lf_hand_on_obj, manny.base_costume) manny:play_chore(mcc_thunder_end_crouch, manny.base_costume) manny:wait_for_chore(mcc_thunder_end_crouch, manny.base_costume) manny:stop_chore(mcc_thunder_end_crouch, manny.base_costume) end END_CUT_SCENE() end end th.ladder_bot.use_coffeepot = th.ladder_bot.use th.ladder_top = Object:create(th, "/thtx002/top", 0.495107, -0.087508596, 2.536, { range = 1.2 }) th.ladder_top.use_pnt_x = 0.495 th.ladder_top.use_pnt_y = -0.064999998 th.ladder_top.use_pnt_z = 2.2 th.ladder_top.use_rot_x = 0 th.ladder_top.use_rot_y = 269.82401 th.ladder_top.use_rot_z = 0 th.ladder_top.lookAt = function(arg1) -- line 1149 system.default_response("ladder") end th.ladder_top.pickUp = th.ladder_bot.pickUp th.ladder_top.use = function(arg1) -- line 1155 if manny:walkto_object(arg1) then START_CUT_SCENE() manny:head_look_at(th.ladder_bot) manny:play_chore(msb_reach_low, manny.base_costume) manny:play_chore(msb_lf_hand_on_obj, manny.base_costume) sleep_for(1000) th:current_setup(th_stgws) manny:stop_chore(msb_reach_low, manny.base_costume) manny:put_at_object(th.ladder_bot) manny:head_look_at(th.ladder_top) manny:wait_for_chore(msb_lf_hand_on_obj, manny.base_costume) manny:stop_chore(msb_lf_hand_on_obj, manny.base_costume) manny:play_chore(msb_lf_hand_off_obj, manny.base_costume) manny:wait_for_chore(msb_lf_hand_off_obj, manny.base_costume) manny:stop_chore(msb_lf_hand_off_obj, manny.base_costume) END_CUT_SCENE() end end th.ladder_top.use_coffeepot = th.ladder_top.use th.coffee_pot = Object:create(th, "/thtx086/pot of coffee", -0.30750701, -2.2220199, 0.34999999, { range = 0.60000002 }) th.coffee_pot.string_name = "coffeepot" th.coffee_pot.use_pnt_x = -0.44588 th.coffee_pot.use_pnt_y = -1.9993 th.coffee_pot.use_pnt_z = 0 th.coffee_pot.use_rot_x = 0 th.coffee_pot.use_rot_y = 225.011 th.coffee_pot.use_rot_z = 0 th.coffee_pot.wav = "getBotl.wav" th.coffee_pot.can_put_away = FALSE th.coffee_pot.lookAt = function(arg1) -- line 1191 arg1.seen = TRUE manny:say_line("/thma087/") end th.coffee_pot.pickUp = function(arg1) -- line 1196 local local1 box_on("coffee_box") if manny:walkto_object(arg1) then START_CUT_SCENE() if manny.fancy then local1 = "mcc_coffee.cos" else local1 = "msb_coffee.cos" end manny:push_costume(local1) th.coffeepot_actor:set_visibility(FALSE) manny:play_chore(msb_coffee_get_coffee, local1) sleep_for(1000) start_sfx("thPotUp.WAV") manny:wait_for_chore(msb_coffee_get_coffee, local1) manny:pop_costume() manny:setrot(0, 299.58401, 0) manny:generic_pickup(arg1) manny:walkto(-0.25503299, -1.8238699, 0) if not arg1.seen then look_at_item_in_hand() end manny:wait_for_actor() END_CUT_SCENE() box_off("grinder_box1") box_off("grinder_box2") end box_off("coffee_box") th.coffee_rack:make_touchable() end th.coffee_pot.use = function(arg1) -- line 1229 if manny.is_holding == th.coffee_pot then manny:say_line("/thma088/") else th.coffee_pot:pickUp() end end th.coffee_pot.use_grinder = function(arg1) -- line 1237 if th.grinder.has_bone or th.grinder.has_snow then manny:say_line("/thma089/") else th.grinder:default_response() end end th.coffee_pot.default_response = th.coffee_pot.use th.coffee_pot.put_away = function(arg1) -- line 1247 manny:say_line("/thma090/") return FALSE end th.coffee_rack = Object:create(th, "/thtx091/burners", -0.30750701, -2.2220199, 0.34999999, { range = 0.60000002 }) th.coffee_rack.use_pnt_x = -0.44588 th.coffee_rack.use_pnt_y = -1.9993 th.coffee_rack.use_pnt_z = 0 th.coffee_rack.use_rot_x = 0 th.coffee_rack.use_rot_y = 180.32401 th.coffee_rack.use_rot_z = 0 th.coffee_rack:make_untouchable() th.coffee_rack.lookAt = function(arg1) -- line 1264 manny:say_line("/thma092/") end th.coffee_rack.pickUp = th.coffee_rack.lookAt th.coffee_rack.use_coffeepot = function(arg1) -- line 1270 local local1 box_on("coffee_box") if manny:walkto_object(arg1) then START_CUT_SCENE() manny.is_holding = nil if manny.fancy then local1 = "mcc_coffee.cos" manny:stop_chore(mcc_thunder_hold, manny.base_costume) manny:stop_chore(mcc_thunder_activate_coffeepot, manny.base_costume) else local1 = "msb_coffee.cos" manny:stop_chore(msb_hold, manny.base_costume) manny:stop_chore(msb_activate_coffeepot, manny.base_costume) end manny:push_costume(local1) manny:setrot(0, 225, 0) manny:play_chore(msb_coffee_pot_to_burner, local1) sleep_for(900) start_sfx("thPotDn.WAV") manny:wait_for_chore(msb_coffee_pot_to_burner, local1) th.coffeepot_actor:default() manny:pop_costume() manny:setrot(0, 299.58401, 0) manny:walkto(-0.25503299, -1.8238699, 0) manny:wait_for_actor() END_CUT_SCENE() th.coffee_pot:free() th.coffee_pot:make_touchable() arg1:make_untouchable() box_on("grinder_box1") box_on("grinder_box2") end box_off("coffee_box") end th.dressing_room = Object:create(th, "/thtx093/dressing room", 1.35489, -1.1065201, 0.199967, { range = 0.89999998 }) th.dressing_room.use_pnt_x = 0.894467 th.dressing_room.use_pnt_y = -1.0750999 th.dressing_room.use_pnt_z = -0.28999999 th.dressing_room.use_rot_x = 0 th.dressing_room.use_rot_y = 275.81699 th.dressing_room.use_rot_z = 0 th.dressing_room.out_pnt_x = 1.3099999 th.dressing_room.out_pnt_y = -1.155 th.dressing_room.out_pnt_z = -0.28999999 th.dressing_room.out_rot_x = 0 th.dressing_room.out_rot_y = 248.313 th.dressing_room.out_rot_z = 0 th.dressing_room.lookAt = function(arg1) -- line 1324 manny:say_line("/thma094/") end th.dressing_room.walkOut = function(arg1) -- line 1328 start_script(th.crash_dressing_room) end th.thunderboy1 = Object:create(th, "/thtx095/Thunder Boy", 0.79973602, -0.57853103, 0.44, { range = 0.80000001 }) th.thunderboy1.use_pnt_x = 0.51973599 th.thunderboy1.use_pnt_y = -0.51853102 th.thunderboy1.use_pnt_z = 0 th.thunderboy1.use_rot_x = 0 th.thunderboy1.use_rot_y = -122.034 th.thunderboy1.use_rot_z = 0 th.thunderboy1.person = TRUE th.thunderboy1.lookAt = function(arg1) -- line 1344 START_CUT_SCENE() manny:say_line("/thma096/") manny:wait_for_message() thunder_boy_2:say_line("/tht2097/") thunder_boy_2:wait_for_message() END_CUT_SCENE() end th.thunderboy1.pickUp = function(arg1) -- line 1353 manny:say_line("/thma098/") end th.thunderboy1.use = function(arg1) -- line 1357 if not th.mocked then START_CUT_SCENE() manny:say_line("/thma099/") wait_for_message() END_CUT_SCENE() end start_script(th.back_off) end th.thunderboy1.use_coffeepot = function(arg1) -- line 1367 start_script(th.serve_coffee) end th.thunderboy2 = Object:create(th, "/thtx100/Thunder Boy", 0.672732, -0.18703701, 0.456, { range = 0.80000001 }) th.thunderboy2.use_pnt_x = 0.51973599 th.thunderboy2.use_pnt_y = -0.51853102 th.thunderboy2.use_pnt_z = 0 th.thunderboy2.use_rot_x = 0 th.thunderboy2.use_rot_y = -122.034 th.thunderboy2.use_rot_z = 0 th.thunderboy2.parent = th.thunderboy1 th.thunderboys_from_above = Object:create(th, "/thtx101/Thunder Boys", 0.69005603, -0.58999997, 2.1800001, { range = 0.60000002 }) th.thunderboys_from_above.use_pnt_x = 0.477274 th.thunderboys_from_above.use_pnt_y = -0.1777813 th.thunderboys_from_above.use_pnt_z = 2.2 th.thunderboys_from_above.use_rot_x = 0 th.thunderboys_from_above.use_rot_y = 171.567 th.thunderboys_from_above.use_rot_z = 0 th.thunderboys_from_above.person = TRUE th.thunderboys_from_above.lookAt = function(arg1) -- line 1394 START_CUT_SCENE() manny:say_line("/thma102/") manny:wait_for_message() manny:say_line("/thma103/") END_CUT_SCENE() end th.thunderboys_from_above.use = function(arg1) -- line 1403 START_CUT_SCENE() manny:say_line("/thma104/") manny:wait_for_message() thunder_boy_1:say_line("/tht1105/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2106/") thunder_boy_2:wait_for_message() thunder_boy_2:say_line("/tht2107/") END_CUT_SCENE() end th.thunderboys_from_above.use_grinder = function(arg1) -- line 1415 local local1 if th.grinder.has_bone or th.grinder.has_snow then local1 = TRUE end th.grinder:use() if local1 then START_CUT_SCENE() if not th.talked_dandruff then th.talked_dandruff = TRUE thunder_boy_1:say_line("/tht1108/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2109/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1110/") thunder_boy_1:wait_for_message() else thunder_boy_1:say_line("/tht1111/") thunder_boy_1:wait_for_message() thunder_boy_2:say_line("/tht2112/") thunder_boy_2:wait_for_message() thunder_boy_1:say_line("/tht1113/") thunder_boy_1:wait_for_message() end END_CUT_SCENE() end end th.thunderboys_from_above.use_coffeepot = function(arg1) -- line 1446 if manny:walkto_object(arg1) then start_script(th.burn_thunderboy_burn) end end th.te_door = Object:create(th, "/thtx114/basement", -0.890948, -1.26624, 0.13, { range = 0.60000002 }) th.te_door.use_pnt_x = -0.53868401 th.te_door.use_pnt_y = -1.2299401 th.te_door.use_pnt_z = 0 th.te_door.use_rot_x = 0 th.te_door.use_rot_y = 78.479599 th.te_door.use_rot_z = 0 th.te_door.out_pnt_x = -0.53868401 th.te_door.out_pnt_y = -1.2299401 th.te_door.out_pnt_z = 0 th.te_door.out_rot_x = 0 th.te_door.out_rot_y = 78.479599 th.te_door.out_rot_z = 0 th.te_door.walkOut = function(arg1) -- line 1473 local local1 if manny.is_holding == th.coffee_pot then manny:say_line("/thma115/") else START_CUT_SCENE() th:climb_out() te:switch_to_set() manny:put_in_set(te) local1 = te.th_ladder.base manny:setpos(local1.use_pnt_x, local1.use_pnt_y, local1.use_pnt_z) manny:push_costume(manny.ladder_costume) manny:play_chore(ma_ladder_generic_jump_off, manny.ladder_costume) manny:wait_for_chore(ma_ladder_generic_jump_off, manny.ladder_costume) manny:pop_costume() manny:walkto(-4.9533801, -0.384285, 0, 0, 284.59399, 0) END_CUT_SCENE() end end th.te_door.lookAt = function(arg1) -- line 1494 manny:say_line("/thma116/") end th.te_door.use = th.te_door.walkOut CheckFirstTime("vd.lua") vd = Set:create("vd.set", "vault door", { vd_top = 0, vd_safex = 1, vd_safex1 = 1, vd_safcu = 2 }) vd.shrinkable = 0.04 vd.wheel_vol = 30 dofile("mn_open_safe.lua") dofile("mn_scythe_door.lua") vd.meches_muffled_cries = function() -- line 19 while 1 do meche:say_line(pick_one_of({ "/vdmc001/", "/vdmc002/", "/vdmc003/", "/vdmc004/", "/vdmc005/", "/vdmc006/", "/vdmc007/", "/vdmc008/", "/vdmc009/", "/vdmc010/", "/vdmc011/", "/vdmc012/", "/vdmc013/", "/vdmc014/", "/vdmc015/", "/vdmc016/", "/vdmc017/", "/vdmc018/", "/vdmc019/" }), { background = TRUE, skip_log = TRUE }) sleep_for(5000) end end vd.scythe_fall = function() -- line 45 local local1 = 0 local local2 = { } local local3 = start_script(vd.scythe_sideways) start_sfx("scythfal.wav") repeat local1 = local1 + PerSecond(5) if local1 > 90 then local1 = 90 end local2 = door_scythe:getrot() door_scythe:setrot(local2.x, local2.y, local2.z - local1) break_here() local2 = door_scythe:getrot() until local2.z <= -90 door_scythe:setrot(local2.x, local2.y, -90) wait_for_script(local3) end vd.scythe_sideways = function() -- line 65 local local1 = { } local local2 = 0.0099999998 repeat local1 = door_scythe:getpos() local2 = local2 + PerSecond(0.0049999999) door_scythe:setpos(local1.x + local2, local1.y, local1.z) break_here() until local1.x >= 0.223141 door_scythe:setpos(0.223141, local1.y, local1.z) end vd.open_safe = function() -- line 77 local local1 cur_puzzle_state[39] = TRUE START_CUT_SCENE() manny:play_chore(ms_hand_on_obj, manny.base_costume) manny:wait_for_chore() vd.handle:play_chore(2) manny:play_chore(ms_hand_off_obj, manny.base_costume) vd.handle:wait_for_chore() vd.handle:play_chore(0) vd.door_jam:play_chore(1) vd.safe_door:free() StartMovie("vd.snm", nil, 233, 119) local1 = start_script(vd.scythe_fall) wait_for_movie() music_state:set_sequence(seqOpenVault) vd.door_jam:play_chore(2) vd.door_open = TRUE music_state:update() wait_for_script(local1) manny:walkto(-0.105456, 0.34172001, 0, 0, -11.4314, 0) manny:play_chore(50, manny.base_costume) mn2_event = FALSE repeat break_here() until mn2_event door_scythe:free() mo.scythe:get() MakeSectorActive("scythe_here", TRUE) vd.tumblers.secured = FALSE manny:wait_for_chore() manny.is_holding = mo.scythe open_inventory(TRUE, TRUE) vd.tumblers.name = "tumblers" vd.tumblers:make_untouchable() vd.wheel:make_untouchable() vd.handle:make_untouchable() vd.vo_door:make_touchable() MakeSectorActive("safe_passage", TRUE) if not vd.cracked_safe then vd.cracked_safe = TRUE wait_for_message() manny:say_line("/vdma020/") wait_for_message() manny:say_line("/vdma021/") wait_for_message() sleep_for(750) manny:say_line("/vdma022/") manny:tilt_head_gesture() end END_CUT_SCENE() end system.tumblerTemplate = { name = "<unnamed>", actor = nil, pos = nil, rot = nil, lock = nil, lock_val = nil, lock_pin = nil } Tumbler = system.tumblerTemplate Tumbler.create = function(arg1, arg2, arg3) -- line 148 local local1 = { } local1.parent = Tumbler local1.name = arg2 local1.actor = Actor:create(nil, nil, nil, arg2) local1.rot = rndint(0, 359) local1.lock_val = local1.rot local1.pos = arg3 local1.lock = FALSE local1.lock_pin = rndint(0, 359) return local1 end Tumbler.set_up_actor = function(arg1) -- line 164 arg1.actor:set_costume("tumbler.cos") arg1.actor:play_chore_looping(0) arg1.actor:put_in_set(vd) arg1.actor:setrot(0, arg1.rot, 0) arg1.actor:set_softimage_pos(arg1.pos.x, arg1.pos.y, arg1.pos.z) arg1:reset_lock_value() start_script(arg1.monitor_rot, arg1) start_script(arg1.make_noise, arg1) end Tumbler.monitor_rot = function(arg1) -- line 175 while 1 do arg1.actor:setrot(0, arg1.rot, 0) break_here() end end Tumbler.make_noise = function(arg1) -- line 182 local local1 = { } local local2, local3 while 1 do local1 = arg1.actor:getrot() if abs(arg1.rot - local1.y) > 15 then if vd:current_setup() == vd_safcu then local3 = rndint(50, 80) else local3 = rndint(10, 40) end local2 = pick_one_of({ "vdTmbl1.wav", "vdTmbl2.wav", "vdTmbl3.wav", "vdTmbl4.wav" }) start_sfx(local2, IM_LOW_PRIORITY, local3) wait_for_sound(local2) else break_here() end end end Tumbler.reset_lock_value = function(arg1) -- line 204 local local1 = arg1.actor:get_positive_rot() arg1.lock = FALSE arg1.lock_val = local1.y + arg1.lock_pin if arg1.lock_val >= 360 then arg1.lock_val = arg1.lock_val - 360 end end Tumbler.scramble = function(arg1, arg2) -- line 217 local local1 = 100 local local2 = rnd() local local3 = { } repeat if local2 then arg1.rot = arg1.rot - local1 else arg1.rot = arg1.rot + local1 end local1 = local1 - PerSecond(15) break_here() until local1 <= 0 local3 = arg1.actor:get_positive_rot() arg1.rot = floor(local3.y) arg1:reset_lock_value() if arg2 then arg1.lock = TRUE end end Tumbler.free = function(arg1) -- line 238 arg1.actor:free() stop_script(arg1.monitor_rot) stop_script(arg1.make_noise) end system.safeTemplate = { name = "<unnamed>", tumblers = nil, wheel = nil, current_setting = nil, direction = nil } Safe = system.safeTemplate Safe.create = function(arg1, arg2) -- line 252 local local1 = { } local1.parent = Safe local1.name = arg2 local1.tumblers = { } local1.wheel = { } local1.current_setting = 0 local1.direction = CLOCKWISE local1.tumblers[1] = Tumbler:create("t1", { x = 1.1426001, y = 3.0685, z = -6.4158001 }) local1.tumblers[2] = Tumbler:create("t2", { x = 1.1426001, y = 3.2776999, z = -6.4158001 }) local1.tumblers[3] = Tumbler:create("t3", { x = 1.1426001, y = 3.4872999, z = -6.4158001 }) local1.tumblers[4] = Tumbler:create("t4", { x = 1.1426001, y = 3.7004001, z = -6.4158001 }) local1.wheel = Actor:create(nil, nil, nil, "wheel") return local1 end Safe.set_up_actors = function(arg1) -- line 274 arg1.tumblers[1]:set_up_actor() arg1.tumblers[2]:set_up_actor() arg1.tumblers[3]:set_up_actor() arg1.tumblers[4]:set_up_actor() if meche.locked_up or cur_puzzle_state[41] == TRUE then arg1.wheel:set_costume("vault_wheel.cos") arg1.wheel:put_in_set(vd) arg1.wheel:set_softimage_pos(-0.6378, 3.4855, -6.3778) arg1.wheel:setrot(0, 180, 0) end arg1.tumblers[1].lock = TRUE start_script(arg1.monitor_lock, arg1) start_script(arg1.monitor_tumblers, arg1) end CLOCKWISE = 0 C_CLOCKWISE = 1 Safe.monitor_lock = function(arg1) -- line 298 arg1.direction = CLOCKWISE while 1 do while arg1.direction == CLOCKWISE do break_here() end arg1.tumblers[2]:reset_lock_value() arg1.tumblers[3]:reset_lock_value() arg1.tumblers[4]:reset_lock_value() while arg1.direction == C_CLOCKWISE do break_here() end arg1.tumblers[2]:reset_lock_value() arg1.tumblers[3]:reset_lock_value() arg1.tumblers[4]:reset_lock_value() end end Safe.monitor_tumblers = function(arg1) -- line 320 while 1 do if arg1.tumblers[1].rot >= 248 and arg1.tumblers[1].rot <= 290 and (arg1.tumblers[2].rot >= 248 and arg1.tumblers[2].rot <= 290) and (arg1.tumblers[3].rot >= 248 and arg1.tumblers[3].rot <= 290) and (arg1.tumblers[4].rot >= 248 and arg1.tumblers[4].rot <= 290) then vd.tumblers.alligned = TRUE else vd.tumblers.alligned = FALSE end break_here() end end Safe.scramble = function(arg1) -- line 335 start_script(arg1.tumblers[1].scramble, arg1.tumblers[1], TRUE) start_script(arg1.tumblers[2].scramble, arg1.tumblers[2]) start_script(arg1.tumblers[3].scramble, arg1.tumblers[3]) arg1.tumblers[4]:scramble() end Safe.spin_tumblers_right = function(arg1) -- line 342 if not find_script(arg1.scramble) then if arg1.tumblers[1].lock then arg1.tumblers[1].rot = arg1.tumblers[1].rot + 1 if arg1.tumblers[1].rot == 360 then arg1.tumblers[1].rot = 0 end if arg1.tumblers[1].rot == arg1.tumblers[2].lock_val and arg1.tumblers[2].lock == FALSE then arg1.tumblers[2].lock = TRUE end end if arg1.tumblers[2].lock then arg1.tumblers[2].rot = arg1.tumblers[2].rot + 1 if arg1.tumblers[2].rot == 360 then arg1.tumblers[2].rot = 0 end if arg1.tumblers[2].rot == arg1.tumblers[3].lock_val and arg1.tumblers[3].lock == FALSE then arg1.tumblers[3].lock = TRUE end end if arg1.tumblers[3].lock then arg1.tumblers[3].rot = arg1.tumblers[3].rot + 1 if arg1.tumblers[3].rot == 360 then arg1.tumblers[3].rot = 0 end if arg1.tumblers[3].rot == arg1.tumblers[4].lock_val and arg1.tumblers[4].lock == FALSE then arg1.tumblers[4].lock = TRUE end end if arg1.tumblers[4].lock then arg1.tumblers[4].rot = arg1.tumblers[4].rot + 1 if arg1.tumblers[4].rot == 360 then arg1.tumblers[4].rot = 0 end end end end Safe.spin_tumblers_left = function(arg1) -- line 386 if not find_script(arg1.scramble) then if arg1.tumblers[1].lock then arg1.tumblers[1].rot = arg1.tumblers[1].rot - 1 if arg1.tumblers[1].rot == -1 then arg1.tumblers[1].rot = 359 end if arg1.tumblers[1].rot == arg1.tumblers[2].lock_val and arg1.tumblers[2].lock == FALSE then arg1.tumblers[2].lock = TRUE end end if arg1.tumblers[2].lock then arg1.tumblers[2].rot = arg1.tumblers[2].rot - 1 if arg1.tumblers[2].rot == -1 then arg1.tumblers[2].rot = 359 end if arg1.tumblers[2].rot == arg1.tumblers[3].lock_val and arg1.tumblers[3].lock == FALSE then arg1.tumblers[3].lock = TRUE end end if arg1.tumblers[3].lock then arg1.tumblers[3].rot = arg1.tumblers[3].rot - 1 if arg1.tumblers[3].rot == -1 then arg1.tumblers[3].rot = 359 end if arg1.tumblers[3].rot == arg1.tumblers[4].lock_val and arg1.tumblers[4].lock == FALSE then arg1.tumblers[4].lock = TRUE end end if arg1.tumblers[4].lock then arg1.tumblers[4].rot = arg1.tumblers[4].rot - 1 if arg1.tumblers[4].rot == -1 then arg1.tumblers[4].rot = 359 end end end end vd.play_wheel_sfx = function() -- line 430 if not sound_playing("vdWeel1.wav") or sound_playing("vdWeel2.wav") or sound_playing("vdWeel3.wav") or sound_playing("vdWeel4.wav") then sfx = pick_from_nonweighted_table({ "vdWeel1.wav", "vdWeel2.wav", "vdWeel3.wav", "vdWeel4.wav" }) start_sfx(pick_one_of({ "vdWeel1.wav", "vdWeel2.wav", "vdWeel3.wav", "vdWeel4.wav" }), IM_MED_PRIORITY, vd.wheel_vol) end end Safe.spin_left = function(arg1, arg2) -- line 439 local local1 arg1.direction = C_CLOCKWISE vd.play_wheel_sfx() arg1.current_setting = arg1.current_setting + arg2 if arg1.current_setting >= 360 then arg1.current_setting = arg1.current_setting - 360 end arg1.wheel:setrot(0, 180, arg1.current_setting) end Safe.spin_right = function(arg1, arg2) -- line 450 local local1 arg1.direction = CLOCKWISE vd.play_wheel_sfx() arg1.current_setting = arg1.current_setting - arg2 if arg1.current_setting <= 0 then arg1.current_setting = arg1.current_setting + 360 end arg1.wheel:setrot(0, 180, arg1.current_setting) end Safe.free = function(arg1) -- line 463 arg1.tumblers[1]:free() arg1.tumblers[2]:free() arg1.tumblers[3]:free() arg1.tumblers[4]:free() arg1.wheel:free() stop_script(arg1.monitor_lock) stop_script(arg1.monitor_tumblers) end vd.hide_actors = function() -- line 476 vd.safe_door.tumblers[1].actor:set_visibility(FALSE) vd.safe_door.tumblers[2].actor:set_visibility(FALSE) vd.safe_door.tumblers[3].actor:set_visibility(FALSE) vd.safe_door.tumblers[4].actor:set_visibility(FALSE) while not vd.door_busted do if vd.cameraChange then if vd:current_setup() == vd_safex then vd.safe_door.tumblers[1].actor:set_visibility(FALSE) vd.safe_door.tumblers[2].actor:set_visibility(FALSE) vd.safe_door.tumblers[3].actor:set_visibility(FALSE) vd.safe_door.tumblers[4].actor:set_visibility(FALSE) else vd.safe_door.tumblers[1].actor:set_visibility(TRUE) vd.safe_door.tumblers[2].actor:set_visibility(TRUE) vd.safe_door.tumblers[3].actor:set_visibility(TRUE) vd.safe_door.tumblers[4].actor:set_visibility(TRUE) end end break_here() end vd.safe_door.tumblers[1].actor:set_visibility(TRUE) vd.safe_door.tumblers[2].actor:set_visibility(TRUE) vd.safe_door.tumblers[3].actor:set_visibility(TRUE) vd.safe_door.tumblers[4].actor:set_visibility(TRUE) end vd.safe_fun = function() -- line 503 START_CUT_SCENE() if vd.door_busted then vd:current_setup(vd_safcu) manny:walkto(-0.0345833, 0.276218, 0, 0, 10.5, 0) manny:wait_for_actor() manny:set_rest_chore(-1) manny:play_chore(18, manny.base_costume) manny:wait_for_chore() else manny:walkto(0.00651957, 0.218281, 0, 0, 0, 0) manny:wait_for_actor() manny:push_costume("mn_open_safe.cos") manny:play_chore(mn_open_safe_hand_on_wheel) manny:wait_for_chore() manny:play_chore(mn_open_safe_hold_wheel) end inventory_save_handler = system.buttonHandler system.buttonHandler = vd.buttonHandler END_CUT_SCENE() end vd.turn_clockwise = function() -- line 526 local local1 = 5 local local2 = 0 START_CUT_SCENE() if vd.door_busted then manny:play_chore_looping(49, manny.base_costume) while get_generic_control_state("TURN_RIGHT") do vd.safe_door:spin_right(local1) local2 = 0 repeat vd.safe_door:spin_tumblers_right() local2 = local2 + 1 until local2 == local1 local1 = local1 + 3 if local1 >= 20 then local1 = 20 end vd.play_wheel_sfx() break_here() end manny:set_chore_looping(49, FALSE, manny.base_costume) manny:wait_for_chore(49, manny.base_costume) else manny:play_chore(mn_open_safe_turn_right) start_script(vd.safe_door.spin_right, vd.safe_door, 45) manny:wait_for_chore() manny:play_chore(mn_open_safe_hold_wheel) end END_CUT_SCENE() end vd.turn_counterclockwise = function() -- line 561 local local1 = 5 local local2 START_CUT_SCENE() if vd.door_busted then manny:play_chore_looping(49, manny.base_costume) while get_generic_control_state("TURN_LEFT") do vd.safe_door:spin_left(local1) local2 = 0 repeat vd.safe_door:spin_tumblers_left() local2 = local2 + 1 until local2 == local1 local1 = local1 + 3 if local1 >= 20 then local1 = 20 end vd.play_wheel_sfx() break_here() end manny:set_chore_looping(49, FALSE, manny.base_costume) manny:wait_for_chore(49, manny.base_costume) else manny:play_chore(mn_open_safe_turn_left) start_script(vd.safe_door.spin_right, vd.safe_door, 45) manny:wait_for_chore() manny:play_chore(mn_open_safe_hold_wheel) end END_CUT_SCENE() end vd.back_off = function() -- line 596 START_CUT_SCENE() if vd.door_busted then vd:current_setup(vd_safex) manny:stop_chore(mn2_use, manny.base_costume) manny:stop_chore(mn2_hand_on_obj, manny.base_costume) manny:play_chore(mn2_hand_off_obj, manny.base_costume) manny:wait_for_chore() manny:stop_chore(mn2_hand_off_obj, manny.base_costume) manny:set_rest_chore(ms_rest, "mn2.cos") else manny:play_chore(mn_open_safe_done_turn) manny:wait_for_chore() manny:pop_costume() end END_CUT_SCENE() system.buttonHandler = inventory_save_handler end vd.buttonHandler = function(arg1, arg2, arg3) -- line 616 if arg1 == EKEY and controlKeyDown and arg2 then start_script(execute_user_command) bHandled = TRUE elseif control_map.TURN_RIGHT[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(vd.turn_clockwise) elseif control_map.TURN_LEFT[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(vd.turn_counterclockwise) elseif control_map.OVERRIDE[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(vd.back_off) elseif control_map.MOVE_BACKWARD[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(vd.back_off) else CommonButtonHandler(arg1, arg2, arg3) end end vd.update_music_state = function(arg1) -- line 638 if meche.locked_up and not vd.door_open then return stateVD else return stateFH end end vd.enter = function(arg1) -- line 648 NewObjectState(vd_safex, OBJSTATE_UNDERLAY, "vd_1_lock.bm") NewObjectState(vd_safex, OBJSTATE_UNDERLAY, "vd_handle.bm") NewObjectState(vd_safex, OBJSTATE_UNDERLAY, "vd_safe_open.bm") vd.door_jam:set_object_state("vd_jam.cos") vd.handle:set_object_state("vd_handle.cos") if not vd.door_open then if vd.door_busted then vd.door_jam:play_chore(0) else vd.door_jam:play_chore(1) end vd.handle:play_chore(0) if not vd.safe_door then vd.safe_door = Safe:create("safe") end vd.safe_door:set_up_actors() start_script(vd.hide_actors) else vd.door_jam:play_chore(2) vd.handle:play_chore(0) end MakeSectorActive("safe_passage", FALSE) if meche.locked_up and not meche_freed then vd.heard_meche = TRUE if vd.door_open then vd.wheel:make_untouchable() vd.handle:make_untouchable() vd.door_jam:make_untouchable() MakeSectorActive("safe_passage", TRUE) elseif vd.door_busted then vd.wheel:make_touchable() vd.handle:make_touchable() vd.door_jam:make_untouchable() vd.tumblers:make_touchable() else start_script(vd.meches_muffled_cries) vd.wheel:make_touchable() vd.handle:make_touchable() vd.door_jam:make_touchable() end elseif cur_puzzle_state[41] == TRUE then vd.wheel:make_touchable() vd.handle:make_touchable() vd.door_jam:make_untouchable() vd.tumblers:make_touchable() else MakeSectorActive("vd_safcu", FALSE) vd.wheel:make_untouchable() vd.handle:make_untouchable() vd.handle:make_untouchable() NewObjectState(vd_safex, OBJSTATE_UNDERLAY, "vd_1_wall.bm") vd.handle:set_object_state("vd_wall.cos") vd.handle:play_chore(0) end if vd.tumblers.secured then MakeSectorActive("scythe_here", FALSE) door_scythe:set_costume("scythe_scythe_door.cos") door_scythe:put_in_set(vd) door_scythe:setpos(0.0055, 0.33717, 0) door_scythe:setrot(0, -6.211, 0) door_scythe:play_chore_looping(0) end end vd.exit = function(arg1) -- line 721 vd.safe_door:free() if door_scythe then door_scythe:free() end stop_script(vd.hide_actors) stop_script(vd.meches_muffled_cries) end vd.wheel = Object:create(vd, "/vdtx023/wheel", -0.071915798, 0.65689498, 0.34, { range = 0.60000002 }) vd.wheel.use_pnt_x = -0.092005402 vd.wheel.use_pnt_y = 0.44999999 vd.wheel.use_pnt_z = 0 vd.wheel.use_rot_x = 0 vd.wheel.use_rot_y = 8.8126001 vd.wheel.use_rot_z = 0 vd.wheel:make_untouchable() vd.wheel.lookAt = function(arg1) -- line 745 soft_script() manny:say_line("/vdma024/") manny:wait_for_message() manny:say_line("/vdma025/") end vd.wheel.use = function(arg1) -- line 752 vd.wheel.tried = TRUE if meche_freed then system.default_response("not now") elseif vd.door_busted then if vd.tumblers.alligned then if vd.tumblers.secured then manny:walkto(0.00651957, 0.218281, 0, 0, 0, 0) manny:wait_for_actor() manny:push_costume("mn_open_safe.cos") manny:play_chore(mn_open_safe_hand_on_wheel) manny:wait_for_chore() manny:play_chore(mn_open_safe_hold_wheel) manny:say_line("/vdma026/") wait_for_message() manny:play_chore(mn_open_safe_done_turn) manny:wait_for_chore() manny:pop_costume() manny:say_line("/vdma027/") else start_script(vd.safe_fun) end else start_script(vd.safe_fun) end else start_script(vd.safe_fun) end end vd.wheel.pickUp = vd.wheel.use vd.wheel.use_chisel = function(arg1) -- line 784 manny:say_line("/vdma028/") end vd.handle = Object:create(vd, "/vdtx029/handle", -0.320117, 0.57889301, 0.38, { range = 0.60000002 }) vd.handle.use_pnt_x = -0.125559 vd.handle.use_pnt_y = 0.33589101 vd.handle.use_pnt_z = 0 vd.handle.use_rot_x = 0 vd.handle.use_rot_y = 416.95801 vd.handle.use_rot_z = 0 vd.handle:make_untouchable() vd.handle.lookAt = function(arg1) -- line 800 manny:say_line("/vdma030/") end vd.handle.pickUp = function(arg1) -- line 804 system.default_response("attached") end vd.handle.use = function(arg1) -- line 808 if meche_freed then system.default_response("not now") else START_CUT_SCENE() manny:set_rest_chore(-1) manny:walkto_object(arg1) manny:wait_for_actor() if vd.tumblers.alligned then if vd.tumblers.secured then vd.open_safe() else manny:play_chore(ms_hand_on_obj, manny.base_costume) manny:wait_for_chore() arg1:play_chore(1) start_script(vd.safe_door.scramble, vd.safe_door) manny:play_chore(ms_hand_off_obj, manny.base_costume) manny:wait_for_chore() manny:say_line("/vdma031/") wait_for_message() manny:say_line("/vdma032/") end else manny:play_chore(ms_hand_on_obj, manny.base_costume) manny:wait_for_chore() arg1:play_chore(1) if not vd.tumblers_secured then start_script(vd.safe_door.scramble, vd.safe_door) end manny:play_chore(ms_hand_off_obj, manny.base_costume) manny:wait_for_chore() if vd.wheel.tried then manny:say_line("/vdma033/") else vd.wheel.tried = TRUE vd.wheel:lookAt() end end manny:set_rest_chore(ms_rest, manny.base_costume) END_CUT_SCENE() end end vd.handle.use_chisel = function(arg1) -- line 851 manny:say_line("/vdma034/") end vd.door_jam = Object:create(vd, "/vdtx035/door jam", 0.127995, 0.63, 0.34999999, { range = 0.60000002 }) vd.door_jam.use_pnt_x = 0.057923201 vd.door_jam.use_pnt_y = 0.449918 vd.door_jam.use_pnt_z = 0 vd.door_jam.use_rot_x = 0 vd.door_jam.use_rot_y = -12.8311 vd.door_jam.use_rot_z = 0 vd.door_jam:make_untouchable() vd.door_jam.lookAt = function(arg1) -- line 867 soft_script() manny:say_line("/vdma036/") wait_for_message() manny:say_line("/vdma037/") end vd.door_jam.use = vd.door_jam.lookAt vd.door_jam.use_scythe = function(arg1) -- line 876 soft_script() manny:say_line("/vdma038/") end vd.door_jam.use_hammer = function(arg1) -- line 881 manny:say_line("/vdma039/") end vd.door_jam.use_chisel = function(arg1) -- line 885 START_CUT_SCENE() vd.door_jam:make_untouchable() vd.tumblers:make_touchable() manny:walkto(-0.0135804, 0.218281, 0, 0, 0, 0) manny:wait_for_actor() manny:push_costume("mn_open_safe.cos") manny:play_chore(mn_open_safe_drill_prep) manny:wait_for_chore() manny:stop_chore(mn_open_safe_drill_prep) manny:play_chore(mn_open_safe_drill) sleep_for(3000) StartMovie("safecrak.snm", nil, 152, 0) sleep_for(600) manny:say_line("/vdma040/") manny:stop_chore(mn_open_safe_drill) manny:play_chore(mn_open_safe_drill_done) wait_for_movie() arg1:play_chore(0) vd.door_busted = TRUE manny:wait_for_chore() manny:pop_costume() wait_for_message() manny:say_line("/vdma041/") wait_for_message() manny:say_line("/vdma042/") END_CUT_SCENE() stop_script(vd.meches_muffled_cries) end vd.tumblers = Object:create(vd, "/vdtx043/tumblers", 0.127995, 0.63, 0.34999999, { range = 0.60000002 }) vd.tumblers.use_pnt_x = 0.057923201 vd.tumblers.use_pnt_y = 0.449918 vd.tumblers.use_pnt_z = 0 vd.tumblers.use_rot_x = 0 vd.tumblers.use_rot_y = -12.8311 vd.tumblers.use_rot_z = 0 vd.tumblers:make_untouchable() vd.tumblers.lookAt = function(arg1) -- line 927 if vd.tumblers.alligned then if vd.tumblers.secured then manny:say_line("/vdma044/") else manny:say_line("/vdma045/") end else manny:say_line("/vdma046/") end end vd.tumblers.use_chisel = function(arg1) -- line 939 if vd.tumblers.secured or vd.door_open then system.default_response("not now") elseif meche_freed then system.default_response("not now") else START_CUT_SCENE() manny:walkto(-0.0135804, 0.218281, 0, 0, 0, 0) manny:wait_for_actor() manny:push_costume("mn_open_safe.cos") manny:play_chore(mn_open_safe_drill_prep) manny:wait_for_chore() manny:stop_chore(mn_open_safe_drill_prep) manny:play_chore(mn_open_safe_drill) sleep_for(500) start_script(vd.safe_door.scramble, vd.safe_door) sleep_for(3100) manny:stop_chore(mn_open_safe_drill) manny:play_chore(mn_open_safe_drill_done) manny:wait_for_chore() manny:pop_costume() manny:say_line("/vdma047/") END_CUT_SCENE() end end vd.tumblers.use = function(arg1) -- line 967 if arg1.secured then arg1:pickUp() else START_CUT_SCENE() manny:say_line("/vdma048/") wait_for_message() END_CUT_SCENE() start_script(Sentence, "use", vd_wheel) end end vd.tumblers.pickUp = function(arg1) -- line 979 if meche_freed then system.default_response("not now") else START_CUT_SCENE() if vd.tumblers.secured then manny:walkto(0.0055, 0.33717, 0, 0, -6.211, 0) manny:wait_for_actor() manny:push_costume("mn_scythe_door.cos") door_scythe:free() manny:play_chore(mn_scythe_door_scythe_out_door) manny:wait_for_chore() mo.scythe:get() manny.is_holding = mo.scythe manny.hold_chore = ms_hold_scythe manny:play_chore_looping(mn2_hold_scythe, manny.base_costume) vd.tumblers.secured = FALSE arg1.name = "tumblers" manny:pop_costume() MakeSectorActive("scythe_here", TRUE) else manny:say_line("/vdma049/") end END_CUT_SCENE() end end vd.tumblers.use_scythe = function(arg1) -- line 1006 if meche_freed then system.default_response("not now") else START_CUT_SCENE() manny:walkto(0.0055, 0.33717, 0, 0, -6.211, 0) manny:wait_for_actor() manny:push_costume("mn_scythe_door.cos") manny:play_chore(mn_scythe_door_scythe_in_door) manny:wait_for_chore() if vd.tumblers.alligned then mo.scythe:free() manny.is_holding = nil manny:stop_chore(manny.hold_chore, manny.base_costume) manny.hold_chore = nil vd.tumblers.secured = TRUE arg1.name = "scythe in tumblers" if not door_scythe then door_scythe = Actor:create(nil, nil, nil, "door scythe") end door_scythe:set_costume("scythe_scythe_door.cos") door_scythe:put_in_set(vd) door_scythe:setpos(0.0055, 0.33717, 0) door_scythe:setrot(0, -6.211, 0) door_scythe:play_chore_looping(0) manny:say_line("/vdma050/") manny:pop_costume() MakeSectorActive("scythe_here", FALSE) else manny:play_chore(mn_scythe_door_scythe_out_door) manny:wait_for_chore() manny:pop_costume() mo.scythe.owner = manny manny.is_holding = mo.scythe manny.hold_chore = ms_activate_scythe manny:play_chore_looping(manny.hold_chore, manny.base_costume) manny:say_line("/vdma051/") end END_CUT_SCENE() end end vd.fh_door = Object:create(vd, "door", -0.186533, -0.231243, 0.44999999, { range = 0.60000002 }) vd.fh_door.use_pnt_x = -0.186533 vd.fh_door.use_pnt_y = -0.231243 vd.fh_door.use_pnt_z = 0 vd.fh_door.use_rot_x = 0 vd.fh_door.use_rot_y = -170.83299 vd.fh_door.use_rot_z = 0 vd.fh_door.out_pnt_x = -0.186533 vd.fh_door.out_pnt_y = -0.231243 vd.fh_door.out_pnt_z = 0 vd.fh_door.out_rot_x = 0 vd.fh_door.out_rot_y = -170.83299 vd.fh_door.out_rot_z = 0 vd.fh_box = vd.fh_door vd.fh_door.touchable = FALSE vd.fh_door.walkOut = function(arg1) -- line 1070 fh:come_out_door(fh.vd_door) end vd.vo_door = Object:create(vd, "door", -0.0449185, 0.82523298, 0.49399999, { range = 0.60000002 }) vd.vo_door.use_pnt_x = -0.0449185 vd.vo_door.use_pnt_y = 0.474233 vd.vo_door.use_pnt_z = 0 vd.vo_door.use_rot_x = 0 vd.vo_door.use_rot_y = -5035.4102 vd.vo_door.use_rot_z = 0 vd.vo_door.out_pnt_x = -0.112959 vd.vo_door.out_pnt_y = 0.64996803 vd.vo_door.out_pnt_z = 0 vd.vo_door.out_rot_x = 0 vd.vo_door.out_rot_y = -356.367 vd.vo_door.out_rot_z = 0 vd.vo_door:make_untouchable() vd.vo_door.walkOut = function(arg1) -- line 1096 vo:come_out_door(vo.vd_door) end vd.vo_door.lookAt = function(arg1) -- line 1100 manny:say_line("/vdma053/") end vd.ar_door = Object:create(vd, "door", 0.50083399, 2.45, 0, { range = 0.60000002 }) vd.ar_door.use_pnt_x = 0.47602099 vd.ar_door.use_pnt_y = 2.0909801 vd.ar_door.use_pnt_z = 0 vd.ar_door.use_rot_x = 0 vd.ar_door.use_rot_y = 185.078 vd.ar_door.use_rot_z = 0 vd.ar_door.out_pnt_x = 0.50083399 vd.ar_door.out_pnt_y = 2.45 vd.ar_door.out_pnt_z = 0 vd.ar_door.out_rot_x = 0 vd.ar_door.out_rot_y = -373.83701 vd.ar_door.out_rot_z = 0 vd.ar_box = vd.ar_door vd.ar_door.comeOut = function(arg1) -- line 1121 vd:current_setup(vd_safex) Object.come_out_door(arg1) end vd.ar_door.walkOut = function(arg1) -- line 1126 ar:come_out_door(ar.vd_door) end vd.ar_door.lookAt = function(arg1) -- line 1130 if dr.reunited then manny:say_line("/vdma054/") else manny:say_line("/vdma055/") end end CheckFirstTime("vi.lua") dofile("mn_suitcase.lua") vi = Set:create("vi.set", "vault interior", { vi_top = 0, vi_intla = 1 }) vi.additional_water_droplets = function(arg1) -- line 13 while 1 do sleep_for(rndint(400, 1500)) single_start_sfx(pick_one_of({ "swrDrop1.wav", "swrDrop2.wav", "swrDrop3.wav", "swrDrop4.wav" }), IM_LOW_PRIORITY, rndint(80, 127)) break_here() end end vi.start_sprinkler = function() -- line 22 START_CUT_SCENE() meche_idle_ok = FALSE vi.sprinklers_going = TRUE vi.sprinkler:play_chore_looping(0) start_sfx("viSprink.imu") start_script(vi.additional_water_droplets) if not vi.tried_sprinklers then vi.tried_sprinklers = TRUE manny:say_line("/vima001/") wait_for_message() IrisDown(355, 245, 1000) sleep_for(1500) IrisUp(215, 280, 1000) vi.valve:play_chore(1) manny:say_line("/vima002/") wait_for_message() meche:say_line("/vimc003/") wait_for_message() music_state:set_sequence(seqSprinkler) else sleep_for(500) meche:say_line("/vimc004/") wait_for_message() music_state:set_sequence(seqSprinkler) IrisDown(355, 245, 1000) sleep_for(500) IrisUp(215, 280, 1000) vi.valve:play_chore(1) end meche_idle_ok = TRUE END_CUT_SCENE() end vi.stop_sprinkler = function() -- line 58 START_CUT_SCENE() meche_idle_ok = FALSE vi.sprinklers_going = FALSE vi.sprinkler:stop_chore(0) vi.sprinkler:play_chore(1) stop_sound("viSprink.imu") stop_script(vi.additional_water_droplets) vi.valve:play_chore(2) meche:say_line("/vimc005/") StartMovie("vi.snm", nil, 40, 305) start_sfx("viSprnOf.wav") wait_for_movie() meche_idle_ok = TRUE END_CUT_SCENE() end vi.bicker = function() -- line 75 vi.bickered = TRUE meche_idle_ok = FALSE break_here() meche:say_line("/vimc006/") meche:wait_for_message() meche:say_line("/vimc007/") meche:wait_for_message() meche_idle_ok = TRUE end vi.reconcile = function() -- line 86 START_CUT_SCENE() meche_idle_ok = FALSE manny:say_line("/vima008/") wait_for_message() meche:say_line("/vimc009/") wait_for_message() meche:say_line("/vimc010/") wait_for_message() meche:say_line("/vimc011/") meche_idle_ok = TRUE END_CUT_SCENE() end vi.meche_lookat_manny = function() -- line 102 while 1 do meche:head_look_at_manny() break_here() end end vi.discover_tickets = function() -- line 109 vi.suitcases.seen = TRUE meche_idle_ok = FALSE START_CUT_SCENE() MakeSectorActive("suitcase_box", TRUE) start_script(manny.walkto, manny, -1.09908, -0.465614, 0, 0, 31.61, 0) manny:say_line("/vima012/") wait_for_message() meche:say_line("/vimc013/") meche:play_chore_looping(meche_in_vi_walk) while TurnActorTo(meche.hActor, -1.09908, -0.465614, 0) do break_here() end meche:stop_chore(meche_in_vi_walk) wait_for_message() manny:wait_for_actor() manny:push_costume("mn_suitcase.cos") manny:play_chore(0, "mn_suitcase.cos") sleep_for(1500) music_state:set_sequence(seqDeadTix) suitcase3:set_visibility(FALSE) start_script(vi.meche_lookat_manny) meche:say_line("/vimc014/") wait_for_message() meche:say_line("/vimc015/") wait_for_message() meche:say_line("/vimc016/") wait_for_message() manny:say_line("/vima017/") manny:play_chore(mn_suitcase_close, "mn_suitcase.cos") wait_for_message() meche:say_line("/vimc018/") manny:wait_for_chore() wait_for_message() manny:pop_costume() suitcase3:set_visibility(TRUE) if find_script(vi.escape_safe) then manny:walkto(-0.904647, -0.474899, 0, 0, -440, 0) else manny:walkto(-0.727755, -0.176263, 0, 0, 33, 0) end manny:say_line("/vima019/") wait_for_message() manny:wait_for_actor() manny:say_line("/vima020/") manny:push_costume("mn_gestures.cos") manny:play_chore(manny_gestures_hand_gesture) wait_for_message() manny:say_line("/vima021/") wait_for_message() meche:say_line("/vimc022/") wait_for_message() manny:say_line("/vima023/") manny:play_chore(manny_gestures_head_nod) manny:wait_for_chore() manny:play_chore(manny_gestures_pointing) wait_for_message() manny:wait_for_chore() manny:say_line("/vima024/") manny:play_chore(manny_gestures_shrug) wait_for_message() manny:say_line("/vima025/") wait_for_message() MakeSectorActive("suitcase_box", TRUE) manny:pop_costume() vi.suitcases:lookAt() stop_script(vi.meche_lookat_manny) meche:head_look_at(nil) END_CUT_SCENE() meche_idle_ok = TRUE end vi.break_tile = function() -- line 182 meche_idle_ok = FALSE START_CUT_SCENE() vi.tile_broken = TRUE vi.valve:play_chore(0) vi.valve:wait_for_chore() END_CUT_SCENE() end vi.escape_safe = function() -- line 192 meche_freed = TRUE cur_puzzle_state[41] = TRUE START_CUT_SCENE() MakeSectorActive("suitcase_box", TRUE) manny:walkto(0.101501, -0.338144, 0, 0, -270.681, 0) manny:wait_for_actor() meche:follow_boxes() manny:say_line("/vima026/") manny:hand_gesture() wait_for_message() meche:say_line("/vimc027/") meche:play_chore_looping(meche_in_vi_walk) local local1 = start_script(meche.walkto, meche, -0.24616, -0.21772, 0, 0, 180, 0) wait_for_script(local1) meche:stop_chore(meche_in_vi_walk) meche:play_chore(meche_in_vi_hands_down_hold) wait_for_message() if not vi.suitcases.seen then vi.discover_tickets() wait_for_message() manny:say_line("/vima028/") manny:shrug_gesture() meche:play_chore_looping(meche_in_vi_walk) local local2 = start_script(meche.walkto, meche, -0.24616, -0.21772, 0, 0, 180, 0) wait_for_script(local2) meche:stop_chore(meche_in_vi_walk) else manny:say_line("/vima029/") manny:shrug_gesture() end wait_for_message() manny:say_line("/vima030/") manny:twist_head_gesture() wait_for_message() manny:say_line("/vima031/") wait_for_message() meche:play_chore(meche_in_vi_slide) meche:wait_for_chore() meche:free() stop_sound("viSprink.imu") stop_script(vi.additional_water_droplets) music_state:set_sequence(seqYr3Iris) IrisDown(355, 245, 1000) sleep_for(1500) stop_script(vo.exit_with_axe) vo_axe:free() END_CUT_SCENE() if raised_lamancha then start_script(bl.everybodys_here) else start_script(bl.passengers_before_boat) end end vi.meche_hold = function(arg1, arg2) -- line 250 local local1 = rnd(arg1, arg2) if meche_idle_ok then repeat local1 = local1 - PerSecond(1) break_here() if not meche_idle_ok then local1 = 0 end until local1 <= 0 end end vi.meche_head_idle = function() -- line 263 meche_idle_ok = TRUE while not vi.tile_broken do while meche_idle_ok do if manny_has_axe then meche:head_look_at_manny() while manny_has_axe do break_here() end else meche:head_look_at_point({ x = -0.539173, y = 0.482942, z = 0.276 }) vi.meche_hold(0.5, 5) meche:head_look_at_point({ x = -0.607073, y = 0.219642, z = 0.6374 }) vi.meche_hold(0.5, 5) meche:head_look_at_point({ x = -0.813073, y = 0.219642, z = 0.4295 }) vi.meche_hold(0.5, 5) meche:head_look_at_point({ x = -0.753373, y = 0.247742, z = 0.5051 }) vi.meche_hold(0.5, 5) meche:head_look_at_point({ x = -0.994773, y = 0.288742, z = 0.244 }) vi.meche_hold(0.5, 5) end end meche:head_look_at_manny() while not meche_idle_ok do break_here() end end meche:head_look_at(nil) end vi.meche_arm_idle = function() -- line 294 meche:play_chore(meche_in_vi_xarms) meche:wait_for_chore() while not vi.tile_broken do while meche_idle_ok do meche:play_chore(meche_in_vi_drop_hands) meche:wait_for_chore() vi.meche_hold(5, 9) meche:play_chore(meche_in_vi_xarms) meche:wait_for_chore() vi.meche_hold(5, 9) end break_here() end meche:play_chore(meche_in_vi_xarms) meche:wait_for_chore() end vi.set_up_actors = function(arg1) -- line 314 if not suitcase1 then suitcase1 = Actor:create(nil, nil, nil, "case") end suitcase1:set_costume("mn_suitcase.cos") suitcase1:put_in_set(vi) suitcase1:setpos(-1.06803, -0.238608, -0.139) suitcase1:setrot(0, 75.6, 0) suitcase1:play_chore(mn_suitcase_suitcase_only) if not suitcase2 then suitcase2 = Actor:create(nil, nil, nil, "case") end suitcase2:set_costume("mn_suitcase.cos") suitcase2:put_in_set(vi) suitcase2:setpos(-1.14757, -0.4833, -0.064) suitcase2:setrot(0, 16.6, 0) suitcase2:play_chore(mn_suitcase_suitcase_only) if not suitcase3 then suitcase3 = Actor:create(nil, nil, nil, "case") end suitcase3:set_costume("mn_suitcase.cos") suitcase3:put_in_set(vi) suitcase3:setpos(-1.09908, -0.465614, 0) suitcase3:setrot(0, 31.61, 0) suitcase3:play_chore(mn_suitcase_suitcase_only) meche:set_costume("meche_in_vi.cos") meche:set_mumble_chore(meche_in_vi_mumble) meche:set_talk_chore(1, meche_in_vi_stop_talk) meche:set_talk_chore(2, meche_in_vi_a) meche:set_talk_chore(3, meche_in_vi_c) meche:set_talk_chore(4, meche_in_vi_e) meche:set_talk_chore(5, meche_in_vi_f) meche:set_talk_chore(6, meche_in_vi_l) meche:set_talk_chore(7, meche_in_vi_m) meche:set_talk_chore(8, meche_in_vi_o) meche:set_talk_chore(9, meche_in_vi_t) meche:set_talk_chore(10, meche_in_vi_u) meche:set_head(5, 5, 5, 165, 28, 80) meche:set_look_rate(200) meche:put_in_set(vi) meche:ignore_boxes() meche:setpos(-0.829475, 0.313889, 0) meche:setrot(0, 213, 0) meche.footsteps = footsteps.reverb start_script(vi.meche_head_idle) start_script(vi.meche_arm_idle) end vi.enter = function(arg1) -- line 372 MakeSectorActive("suitcase_box", FALSE) vi:current_setup(vi_intla) vi:set_up_actors() if not vi.bickered and not find_script(slide_show) then start_script(vi.bicker) end NewObjectState(vi_intla, OBJSTATE_UNDERLAY, "vi_tile.bm") NewObjectState(vi_intla, OBJSTATE_UNDERLAY, "vi_water_tile.bm") vi.valve:set_object_state("vi_tile.cos") NewObjectState(vi_intla, OBJSTATE_UNDERLAY, "vi_sprinkler.bm") vi.sprinkler:set_object_state("vi_sprinkler.cos") if vi.sprinklers_going then vi.valve:play_chore(1) vi.sprinkler:play_chore_looping(0) start_script(vi.additional_water_droplets) start_sfx("viSprink.imu") else vi.valve:play_chore(2) vi.sprinkler:play_chore(1) end MakeSectorActive("meche_box", FALSE) if manny_has_axe then MakeSectorActive("noax1", FALSE) MakeSectorActive("noax2", FALSE) MakeSectorActive("noax3", FALSE) else MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) end if vo_axe.currentSet == system.currentSet then vo_axe:put_in_set(vi) vo_axe:setpos(vo_axe.pos_x, vo_axe.pos_y, vo_axe.pos_z) vo_axe:setrot(vo_axe.rot_x, vo_axe.rot_y, vo_axe.rot_z) vo_axe:set_costume("mn_lift_ax.cos") vo_axe:play_chore(3) end SetShadowColor(10, 10, 10) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, -0.7, 0.2, 3.2) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") SetActiveShadow(meche.hActor, 0) SetActorShadowPoint(meche.hActor, -0.7, 0.2, 3.2) SetActorShadowPlane(meche.hActor, "shadow1") AddShadowPlane(meche.hActor, "shadow1") end vi.exit = function(arg1) -- line 429 meche:free() suitcase1:free() suitcase2:free() suitcase3:free() stop_script(vi.meche_head_idle) stop_script(vi.meche_arm_idle) stop_script(vi.additional_water_droplets) stop_sound("viSprink.imu") KillActorShadows(manny.hActor) KillActorShadows(meche.hActor) end vi.suitcases = Object:create(vi, "/vitx032/suitcases", -1.3056901, -0.404212, 0.27000001, { range = 0.60000002 }) vi.suitcases.use_pnt_x = -1.01569 vi.suitcases.use_pnt_y = -0.53421199 vi.suitcases.use_pnt_z = 0 vi.suitcases.use_rot_x = 0 vi.suitcases.use_rot_y = -279.534 vi.suitcases.use_rot_z = 0 vi.suitcases.lookAt = function(arg1) -- line 457 if not arg1.seen then start_script(vi.discover_tickets) else manny:say_line("/vima033/") end end vi.suitcases.pickUp = vi.suitcases.lookAt vi.suitcases.use = vi.suitcases.lookAt vi.valve = Object:create(vi, "/vitx034/valve", -0.192596, -1.20491, 0.31, { range = 0.60000002 }) vi.valve.use_pnt_x = -0.385097 vi.valve.use_pnt_y = -1.23524 vi.valve.use_pnt_z = 0 vi.valve.use_rot_x = 0 vi.valve.use_rot_y = -436.32101 vi.valve.use_rot_z = 0 vi.valve.opened = TRUE vi.valve.lookAt = function(arg1) -- line 479 manny:say_line("/vima035/") end vi.valve.open = function(arg1) -- line 483 arg1.opened = TRUE START_CUT_SCENE() manny:walkto_object(arg1) manny:wait_for_actor() manny:set_rest_chore(nil) manny:play_chore(mn2_reach_med, manny.base_costume) start_sfx("viValve.wav", nil, 90) manny:wait_for_chore() manny:set_rest_chore(mn2_rest, manny.base_costume) END_CUT_SCENE() if vi.sprinkler_activated then start_script(vi.start_sprinkler) end end vi.valve.close = function(arg1) -- line 499 arg1.opened = FALSE START_CUT_SCENE() manny:walkto_object(arg1) manny:wait_for_actor() manny:set_rest_chore(nil) manny:play_chore(mn2_reach_med, manny.base_costume) start_sfx("viValve.wav", nil, 90) manny:wait_for_chore() manny:set_rest_chore(mn2_rest, manny.base_costume) END_CUT_SCENE() if vi.sprinkler_activated then start_script(vi.stop_sprinkler) end end vi.valve.use = function(arg1) -- line 515 if arg1:is_open() then arg1:close() else arg1:open() end end vi.meche_obj = Object:create(vi, "/vitx036/Meche", -0.811068, 0.30837601, 0.52029997, { range = 0.69999999 }) vi.meche_obj.use_pnt_x = -0.77146798 vi.meche_obj.use_pnt_y = -0.128224 vi.meche_obj.use_pnt_z = 0 vi.meche_obj.use_rot_x = 0 vi.meche_obj.use_rot_y = 44.716599 vi.meche_obj.use_rot_z = 0 vi.meche_obj.lookAt = function(arg1) -- line 531 if vi.sprinklers_going then manny:say_line("/vima037/") elseif not vi.reconciled then manny:say_line("/vima038/") else arg1:use() end end vi.meche_obj.pickUp = function(arg1) -- line 543 START_CUT_SCENE() manny:say_line("/vima039/") wait_for_message() meche:say_line("/vimc040/") meche:wait_for_message() manny:say_line("/vima040b/") END_CUT_SCENE() end vi.meche_obj.use = function(arg1) -- line 553 if not vi.reconciled then vi.reconciled = TRUE start_script(vi.reconcile) else START_CUT_SCENE() manny:say_line("/vima041/") wait_for_message() meche:say_line("/vimc042/") END_CUT_SCENE() end end vi.drain = Object:create(vi, "/vitx043/drain", -0.47740099, -0.653943, 0, { range = 0.60000002 }) vi.drain.use_pnt_x = -0.25740099 vi.drain.use_pnt_y = -0.52394301 vi.drain.use_pnt_z = 0 vi.drain.use_rot_x = 0 vi.drain.use_rot_y = -966.367 vi.drain.use_rot_z = 0 vi.drain:make_untouchable() vi.vent = Object:create(vi, "/vitx044/vent", -0.85521197, 0.46798399, 1.21, { range = 1.5 }) vi.vent.use_pnt_x = -0.41288999 vi.vent.use_pnt_y = 0.16989399 vi.vent.use_pnt_z = 0 vi.vent.use_rot_x = 0 vi.vent.use_rot_y = -1026.98 vi.vent.use_rot_z = 0 vi.vent.lookAt = function(arg1) -- line 585 manny:say_line("/vima045/") end vi.vent.use = function(arg1) -- line 589 START_CUT_SCENE() manny:say_line("/vima046/") if not arg1.tried then arg1.tried = TRUE wait_for_message() meche:say_line("/vimc047/") wait_for_message() manny:say_line("/vima048/") end END_CUT_SCENE() end vi.vent.use_scythe = function(arg1) -- line 602 manny:say_line("/vima049/") end vi.sprinkler = Object:create(vi, "/vitx050/sprinkler", -0.14229301, 0.264732, 1.02, { range = 1.3 }) vi.sprinkler.use_pnt_x = -0.246362 vi.sprinkler.use_pnt_y = -0.056466099 vi.sprinkler.use_pnt_z = 0 vi.sprinkler.use_rot_x = 0 vi.sprinkler.use_rot_y = 117.803 vi.sprinkler.use_rot_z = 0 vi.sprinkler.lookAt = function(arg1) -- line 615 manny:say_line("/vima051/") end vi.sprinkler.use = function(arg1) -- line 619 manny:say_line("/vima052/") end vi.sprinkler.use_chisel = vi.sprinkler.use vi.sprinkler.use_scythe = function(arg1) -- line 625 manny:walkto_object(arg1) manny:wait_for_actor() manny:push_costume("mn_scythe_sprinkler.cos") manny:play_chore(0) sleep_for(2200) start_sfx("viChop.wav") manny:wait_for_chore() manny:pop_costume() vi.sprinkler_activated = TRUE if vi.valve.opened then wait_for_message() start_script(vi.start_sprinkler) end end vi.broadaxe = Object:create(vi, "axe", 0, 0, 0, { range = 1 }) vi.broadaxe.use_pnt_x = 0 vi.broadaxe.use_pnt_y = 0 vi.broadaxe.use_pnt_z = 0 vi.broadaxe.use_rot_x = 0 vi.broadaxe.use_rot_y = 0 vi.broadaxe.use_rot_z = 0 vi.broadaxe:make_untouchable() vi.broadaxe.lookAt = function(arg1) -- line 652 manny:say_line("/voma044/") end vi.broadaxe.pickUp = function(arg1) -- line 657 vo.get_axe() end vi.broadaxe.use = function(arg1) -- line 661 vo.get_axe() end vi.broadaxe.default_response = vi.broadaxe.use vi.vo_door = Object:create(vi, "/vitx053/secret door", 2.00371, -0.26364201, 0.47, { range = 0.69999999 }) vi.vo_door.use_pnt_x = 1.2337101 vi.vo_door.use_pnt_y = -0.26364201 vi.vo_door.use_pnt_z = 0 vi.vo_door.use_rot_x = 0 vi.vo_door.use_rot_y = -455.82001 vi.vo_door.use_rot_z = 0 vi.vo_door.out_pnt_x = 1.6 vi.vo_door.out_pnt_y = -0.30083799 vi.vo_door.out_pnt_z = 0 vi.vo_door.out_rot_x = 0 vi.vo_door.out_rot_y = -455.82001 vi.vo_door.out_rot_z = 0 vi.vo_door.walkOut = function(arg1) -- line 688 if manny_has_axe then vo:switch_to_set() manny:setpos(-1.01436, 1.01177, 0) manny:setrot(0, -280, 0) manny:put_in_set(vo) vo_axe:put_in_set(vo) vi.broadaxe:make_untouchable() vo.broadaxe:make_touchable() else vo:come_out_door(vo.secret_door) end end vi.vo_door.lookAt = function(arg1) -- line 702 manny:say_line("/vima054/") end CheckFirstTime("vo.lua") dofile("mn_lift_ax.lua") dofile("meche_in_vi.lua") vo = Set:create("vo.set", "outer vault", { vo_overhead = 0, vo_intha = 1, vo_amrms = 2 }) vault_meche_init = function() -- line 15 meche:set_walk_chore(meche_in_vi_walk, "meche_in_vi.cos") meche:set_rest_chore(meche_in_vi_hands_down_hold, "meche_in_vi.cos") end aa = function() -- line 21 start_script(vo.open_secret_door) end vo.open_secret_door = function() -- line 25 local local1 cur_puzzle_state[40] = TRUE START_CUT_SCENE() manny:walkto(-0.079352997, 0.39862201, 0, 0, -86.685699, 0) manny:wait_for_actor() manny:push_costume("mn_scythe_door.cos") manny:stop_chore(mn2_hold_scythe, "mn2.cos") manny:play_chore(mn_scythe_door_to_scythe_short) manny:wait_for_chore() StartMovie("vo_vault.snm", nil, 320, 90) vo.secret_door:make_touchable() vo.secret_door.opened = TRUE vo:update_states() manny:play_chore(mn_scythe_door_stop_scythe_short) manny:wait_for_chore() manny:pop_costume() manny:play_chore_looping(mn2_hold_scythe, "mn2.cos") wait_for_movie() wait_for_message() meche:set_costume("meche_sit.cos") meche:set_mumble_chore(meche_sit_mumble) meche:set_talk_chore(1, meche_sit_no_talk) meche:set_talk_chore(2, meche_sit_a) meche:set_talk_chore(3, meche_sit_c) meche:set_talk_chore(4, meche_sit_e) meche:set_talk_chore(5, meche_sit_f) meche:set_talk_chore(6, meche_sit_l) meche:set_talk_chore(7, meche_sit_m) meche:set_talk_chore(8, meche_sit_o) meche:set_talk_chore(9, meche_sit_t) meche:set_talk_chore(10, meche_sit_u) meche:push_costume("meche_in_vi.cos") meche:put_in_set(vo) meche:setpos(-1.47453, 1.4645, 0) meche:setrot(0, -152.509, 0) meche:set_walk_rate(0.30000001) meche:follow_boxes() meche.footsteps = footsteps.reverb meche:play_chore_looping(meche_in_vi_walk, "meche_in_vi.cos") local local2 = start_script(meche.walkto, meche, -1.27968, 1.1593, 0, 0, -129.48, 0) wait_for_script(local2) meche:stop_chore(meche_in_vi_walk, "meche_in_vi.cos") meche:play_chore(meche_in_vi_hands_down_hold, "meche_in_vi.cos") manny:head_look_at(nil) manny:turn_right(180) meche:say_line("/vomc001/") wait_for_message() meche:say_line("/vomc003/") meche:play_chore(meche_in_vi_xarms) meche:wait_for_chore() wait_for_message() manny:say_line("/voma004/") wait_for_message() manny:say_line("/voma005/") meche:play_chore(meche_in_vi_drop_hands) meche:wait_for_chore() meche:play_chore_looping(meche_in_vi_walk) meche:walkto(-1.47453, 1.4645, 0) wait_for_message() meche:say_line("/vomc006/") wait_for_message() meche:free() END_CUT_SCENE() end vo.close_safe = function() -- line 94 START_CUT_SCENE() vd.door_open = FALSE vd.tumblers.alligned = FALSE vd.tumblers.secured = FALSE vd.tumblers:make_touchable() vd.wheel:make_touchable() vd.handle:make_touchable() vo.vd_door:lock() manny:walkto_object(vo.open_door) manny:wait_for_actor() manny:set_rest_chore(-1) manny:play_chore(ms_hand_on_obj, "mn2.cos") manny:wait_for_chore() manny:play_chore(ms_hand_off_obj, "mn2.cos") StartMovie("vo_safe.snm", nil, 0, 120) wait_for_movie() vo:update_states() manny:wait_for_actor() manny:set_rest_chore(ms_rest, "mn2.cos") manny:say_line("/voma007/") wait_for_message() manny:say_line("/voma008/") wait_for_message() manny:say_line("/voma009/") END_CUT_SCENE() end vo.get_axe = function() -- line 122 START_CUT_SCENE() start_script(vo.lockup_watcher) if system.currentSet == vo then manny:walkto_object(vo.broadaxe) MakeSectorActive("noax1", FALSE) MakeSectorActive("noax2", FALSE) MakeSectorActive("noax3", FALSE) MakeSectorActive("noax4", FALSE) MakeSectorActive("noax5", FALSE) MakeSectorActive("noax6", FALSE) MakeSectorActive("noax7", FALSE) MakeSectorActive("noax8", FALSE) MakeSectorActive("noax9", FALSE) MakeSectorActive("noax10", FALSE) MakeSectorActive("noax11", FALSE) MakeSectorActive("under_door", FALSE) if not vd.door_open then MakeSectorActive("door_open", TRUE) MakeSectorActive("door_open2", TRUE) else MakeSectorActive("door_open", FALSE) MakeSectorActive("door_open2", FALSE) end if vo.secret_door.opened then MakeSectorActive("axe_exit", TRUE) MakeSectorActive("secret_pass1", FALSE) MakeSectorActive("secret_pass2", FALSE) else MakeSectorActive("axe_exit", FALSE) end else manny:walkto_object(vi.broadaxe) MakeSectorActive("noax1", FALSE) MakeSectorActive("noax2", FALSE) MakeSectorActive("noax3", FALSE) MakeSectorActive("noax4", FALSE) end manny:wait_for_actor() manny:follow_boxes() manny.base_costume = "mn2.cos" manny.gesture_costume = "mn_gestures.cos" manny:set_costume(manny.base_costume) manny:set_walk_rate(0.4) manny:set_mumble_chore(mn2_mumble) manny:set_talk_chore(1, mn2_stop_talk) manny:set_talk_chore(2, mn2_a) manny:set_talk_chore(3, mn2_c) manny:set_talk_chore(4, mn2_e) manny:set_talk_chore(5, mn2_f) manny:set_talk_chore(6, mn2_l) manny:set_talk_chore(7, mn2_m) manny:set_talk_chore(8, mn2_o) manny:set_talk_chore(9, mn2_t) manny:set_talk_chore(9, mn2_u) manny:set_turn_rate(85) manny.talk_chore = ms_talk manny.stop_talk_chore = ms_stop_talk manny:push_costume("mn_lift_ax.cos") manny:play_chore(mn_lift_ax_lift_ax) sleep_for(1300) start_sfx("voAxGet.wav") vo_axe:set_visibility(FALSE) SetActorReflection(manny.hActor, 90) manny:wait_for_chore() END_CUT_SCENE() manny.idles_allowed = FALSE manny_has_axe = TRUE inventory_disabled = TRUE inventory_save_handler = system.buttonHandler system.buttonHandler = axeButtonHandler vo.broadaxe:make_untouchable() vi.broadaxe:make_untouchable() manny:set_walk_chore(nil) manny:set_rest_chore(nil) manny:stop_chore(mn_lift_ax_lift_ax, "mn_lift_ax.cos") manny:play_chore_looping(mn_lift_ax_hold_ax, "mn_lift_ax.cos") if vo.secret_door.opened then PrintDebug("constraining") start_script(vo.exit_with_axe) end end vo.lower_axe = function() -- line 213 local local1 = { } local local2 = { } local local3 = { x = 0.0103, y = 0.3971, z = 0 } local local4 = { } START_CUT_SCENE() vo.stop_turn() vo.stop_walk() manny:stop_chore(mn_lift_ax_hold_ax) manny:play_chore(mn_lift_ax_lower_ax) sleep_for(1000) local1 = manny:getpos() local2 = manny:get_positive_rot() vo_axe:setpos(local1) vo_axe:setrot(local2) vo_axe.pos_x = local1.x vo_axe.pos_y = local1.y vo_axe.pos_z = local1.z vo_axe.rot_x = local2.x vo_axe.rot_y = local2.y vo_axe.rot_z = local2.z vo_axe.currentSet = system.currentSet vo_axe:set_visibility(TRUE) vo_axe:put_in_set(system.currentSet) local4 = RotateVector(local3, local2) local4.x = local4.x + local1.x local4.y = local4.y + local1.y local4.z = local4.z + local1.z if system.currentSet == vo then vo.broadaxe:make_touchable() vo.broadaxe.interest_actor:put_in_set(vo) vo.broadaxe.obj_x = local4.x vo.broadaxe.obj_y = local4.y vo.broadaxe.obj_z = local4.z vo.broadaxe.interest_actor:setpos(local4) vo.broadaxe.use_pnt_x = local1.x vo.broadaxe.use_pnt_y = local1.y vo.broadaxe.use_pnt_z = local1.z vo.broadaxe.use_rot_x = local2.x vo.broadaxe.use_rot_y = local2.y vo.broadaxe.use_rot_z = local2.z else vi.broadaxe:make_touchable() vi.broadaxe.interest_actor:put_in_set(vi) vi.broadaxe.obj_x = local4.x vi.broadaxe.obj_y = local4.y vi.broadaxe.obj_z = local4.z vi.broadaxe.interest_actor:setpos(local4) vi.broadaxe.use_pnt_x = local1.x vi.broadaxe.use_pnt_y = local1.y vi.broadaxe.use_pnt_z = local1.z vi.broadaxe.use_rot_x = local2.x vi.broadaxe.use_rot_y = local2.y vi.broadaxe.use_rot_z = local2.z end manny_has_axe = FALSE if system.currentSet == vo then MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) MakeSectorActive("noax4", TRUE) MakeSectorActive("noax5", TRUE) MakeSectorActive("noax6", TRUE) MakeSectorActive("noax7", TRUE) MakeSectorActive("noax8", TRUE) MakeSectorActive("noax9", TRUE) MakeSectorActive("noax10", TRUE) MakeSectorActive("noax11", TRUE) vo:update_states() else MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) MakeSectorActive("noax4", TRUE) end manny:wait_for_chore() manny:default("nautical") manny:follow_boxes() END_CUT_SCENE() manny.idles_allowed = TRUE SetActorReflection(manny.hActor, 60) inventory_disabled = FALSE system.buttonHandler = inventory_save_handler manny:head_look_at(nil) end vo.turn_left = function() -- line 313 local local1 = { } manny:play_chore_looping(mn_lift_ax_drag_ax, "mn_lift_ax.cos") start_sfx("voAxTDrg.imu") while 1 do local1 = manny:getrot() manny:setrot(local1.x, local1.y + 10, local1.z, TRUE) break_here() end end vo.turn_right = function() -- line 326 local local1 = { } manny:play_chore_looping(mn_lift_ax_drag_ax, "mn_lift_ax.cos") start_sfx("voAxTDrg.imu") while 1 do local1 = manny:getrot() manny:setrot(local1.x, local1.y - 10, local1.z, TRUE) break_here() end end vo.walk_backward = function() -- line 338 manny:set_walk_rate(-0.2) manny:play_chore_looping(mn_lift_ax_drag_ax, "mn_lift_ax.cos") start_sfx("voAxBDrg.imu") while 1 do manny:walk_forward() break_here() end end vo.stop_turn = function() -- line 348 stop_script(vo.turn_left) stop_script(vo.turn_right) stop_sound("voAxTDrg.imu") if not find_script(vo.walk_backward) then manny:stop_chore(mn_lift_ax_drag_ax, "mn_lift_ax.cos") manny:play_chore_looping(mn_lift_ax_hold_ax, "mn_lift_ax.cos") end end vo.stop_walk = function() -- line 358 stop_script(vo.walk_backward) stop_sound("voAxBDrg.imu") if not find_script(vo.turn_left) and not find_script(vo.turn_right) then manny:stop_chore(mn_lift_ax_drag_ax, "mn_lift_ax.cos") manny:play_chore_looping(mn_lift_ax_hold_ax, "mn_lift_ax.cos") end end vo.exit_with_axe = function() -- line 367 while manny_has_axe do repeat break_here() until manny:find_sector_name("axe_exit") vo.manny_exiting = TRUE vo.stop_turn() if system.currentSet == vo then vo.secret_door:use() else vi.vo_door:walkOut() end while manny:find_sector_name("axe_exit") do break_here() end vo.manny_exiting = FALSE end end vo.lockup_watcher = function() -- line 386 while manny_has_axe do if manny:find_sector_name("secret_door") then vo.secret_door:walkOut() elseif manny:find_sector_name("vo_door") then vi.vo_door:walkOut() end end end axeButtonHandler = function(arg1, arg2, arg3) -- line 396 shiftKeyDown = GetControlState(LSHIFTKEY) or GetControlState(RSHIFTKEY) altKeyDown = GetControlState(LALTKEY) or GetControlState(RALTKEY) controlKeyDown = GetControlState(LCONTROLKEY) or GetControlState(RCONTROLKEY) if arg1 == EKEY and controlKeyDown and arg2 then single_start_script(execute_user_command) bHandled = TRUE elseif control_map.OVERRIDE[arg1] and arg2 and curSceneLevel <= 0 then single_start_script(vo.lower_axe) elseif control_map.TURN_RIGHT[arg1] and cutSceneLevel <= 0 and not vo.manny_exiting then if arg2 then single_start_script(vo.turn_right) else single_start_script(vo.stop_turn) end elseif control_map.TURN_LEFT[arg1] and cutSceneLevel <= 0 and not vo.manny_exiting then if arg2 then single_start_script(vo.turn_left) else single_start_script(vo.stop_turn) end elseif control_map.LOOK_AT[arg1] and arg2 and cutSceneLevel <= 0 then single_start_script(vo.broadaxe.lookAt, vo.broadaxe) elseif control_map.MOVE_BACKWARD[arg1] and cutSceneLevel <= 0 then if arg2 then single_start_script(vo.walk_backward) else single_start_script(vo.stop_walk) end elseif control_map.USE[arg1] and arg2 and cutSceneLevel <= 0 and not vo.manny_exiting then single_start_script(vo.drop_axe) elseif control_map.PICK_UP[arg1] and arg2 and cutSceneLevel <= 0 and not vo.manny_exiting then single_start_script(vo.lower_axe) else CommonButtonHandler(arg1, arg2, arg3) end end drop_test = function() -- line 436 local local1 = { x = -0.236279, y = -0.387934, z = 0 } local local2 = { } local local3 = { } local local4 = manny:getpos() local local5 local local6 = sqrt((local4.x - local1.x) ^ 2 + (local4.y - local1.y) ^ 2 + (local4.z - local1.z) ^ 2) local2.x = local1.x - local4.x local2.y = local1.y - local4.y local2.z = local1.z - local4.z local3.x, local3.y, local3.z = GetActorPuckVector(manny.hActor) local2 = normalize_vector(local2) local3 = normalize_vector(local3) local5 = GetAngleBetweenVectors(local3, local2) if system.currentSet == vi and local6 > 0.15000001 and local6 < 0.43000001 and local5 <= 30 then return TRUE end end vo.drop_axe = function() -- line 458 local local1 = { } local local2 = { } local local3 = { x = 0.0103, y = 0.3971, z = 0 } local local4 = { } local local5 = { x = -0.236279, y = -0.387934, z = 0 } START_CUT_SCENE() vo.stop_turn() vo.stop_walk() manny:stop_chore(mn_lift_ax_hold_ax) manny:play_chore(mn_lift_ax_pickup_ax) manny:say_line("/voma010/") sleep_for(3500) local1 = manny:getpos() local2 = manny:get_positive_rot() vo_axe:setpos(local1) vo_axe:setrot(local2) vo_axe.pos_x = local1.x vo_axe.pos_y = local1.y vo_axe.pos_z = local1.z vo_axe.rot_x = local2.x vo_axe.rot_y = local2.y vo_axe.rot_z = local2.z vo_axe:put_in_set(system.currentSet) vo_axe.currentSet = system.currentSet local4 = RotateVector(local3, local2) local4.x = local4.x + local1.x local4.y = local4.y + local1.y local4.z = local4.z + local1.z if system.currentSet == vo then vo.broadaxe:make_touchable() vo.broadaxe.interest_actor:put_in_set(vo) vo.broadaxe.obj_x = local4.x vo.broadaxe.obj_y = local4.y vo.broadaxe.obj_z = local4.z vo.broadaxe.interest_actor:setpos(local4) vo.broadaxe.use_pnt_x = local1.x vo.broadaxe.use_pnt_y = local1.y vo.broadaxe.use_pnt_z = local1.z vo.broadaxe.use_rot_x = local2.x vo.broadaxe.use_rot_y = local2.y vo.broadaxe.use_rot_z = local2.z else vi.broadaxe:make_touchable() vi.broadaxe.interest_actor:put_in_set(vi) vi.broadaxe.obj_x = local4.x vi.broadaxe.obj_y = local4.y vi.broadaxe.obj_z = local4.z vi.broadaxe.interest_actor:setpos(local4) vi.broadaxe.use_pnt_x = local1.x vi.broadaxe.use_pnt_y = local1.y vi.broadaxe.use_pnt_z = local1.z vi.broadaxe.use_rot_x = local2.x vi.broadaxe.use_rot_y = local2.y vi.broadaxe.use_rot_z = local2.z end local local6 = drop_test() sleep_for(500) if local6 then start_sfx("voAxBrk.wav") vi.break_tile() else start_sfx("voAxDrop.wav") end manny:wait_for_chore() vo_axe:set_visibility(TRUE) manny:default("nautical") manny_has_axe = FALSE manny.idles_allowed = TRUE inventory_disabled = FALSE system.buttonHandler = inventory_save_handler SetActorReflection(manny.hActor, 60) if system.currentSet == vo then MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) MakeSectorActive("noax4", TRUE) MakeSectorActive("noax5", TRUE) MakeSectorActive("noax6", TRUE) MakeSectorActive("noax7", TRUE) MakeSectorActive("noax8", TRUE) MakeSectorActive("noax9", TRUE) MakeSectorActive("noax10", TRUE) MakeSectorActive("noax11", TRUE) vo:update_states() else MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) MakeSectorActive("noax4", TRUE) end END_CUT_SCENE() if local6 then START_CUT_SCENE() vo.get_axe() manny:set_walk_rate(-0.2) manny:play_chore_looping(mn_lift_ax_drag_ax, "mn_lift_ax.cos") local local7 = 0.30000001 start_sfx("voAxBDrg.imu") repeat manny:walk_forward() local7 = local7 - PerSecond(0.2) if local7 < 0 then local7 = 0 end break_here() until local7 == 0 stop_sound("voAxBDrg.imu") manny:stop_chore(mn_lift_ax_drag_ax, "mn_lift_ax.cos") manny:play_chore_looping(mn_lift_ax_hold_ax, "mn_lift_ax.cos") vo.lower_axe() start_script(vi.escape_safe) END_CUT_SCENE() else START_CUT_SCENE() wait_for_message() manny:say_line("/voma011/") if not vo.broadaxe.dropped then vo.broadaxe.dropped = TRUE wait_for_message() manny:say_line("/voma012/") end END_CUT_SCENE() end manny:follow_boxes() end vo.update_states = function(arg1) -- line 602 if vd.door_open then vo.open_door:make_touchable() MakeSectorActive("safe_passage", TRUE) MakeSectorActive("under_door", FALSE) vo.open_door:play_chore(1) else vo.open_door:make_untouchable() MakeSectorActive("safe_passage", FALSE) MakeSectorActive("under_door", TRUE) vo.open_door:play_chore(0) end if vo.secret_door.opened then vo.secret_door:make_touchable() vo.drawers3.parent = Object vo.drawers3:make_untouchable() MakeSectorActive("secret_pass1", TRUE) MakeSectorActive("secret_pass2", TRUE) vo.secret_door:play_chore(0) else MakeSectorActive("axe_exit", FALSE) vo.secret_door:make_untouchable() vo.drawers3:make_touchable() MakeSectorActive("secret_pass1", FALSE) MakeSectorActive("secret_pass2", FALSE) vo.secret_door:play_chore(1) end if manny_has_axe then MakeSectorActive("noax1", FALSE) MakeSectorActive("noax2", FALSE) MakeSectorActive("noax3", FALSE) MakeSectorActive("noax4", FALSE) MakeSectorActive("noax5", FALSE) MakeSectorActive("noax6", FALSE) MakeSectorActive("noax7", FALSE) MakeSectorActive("noax8", FALSE) MakeSectorActive("noax9", FALSE) MakeSectorActive("noax10", FALSE) MakeSectorActive("noax11", FALSE) MakeSectorActive("under_door", FALSE) if not vd.door_open then MakeSectorActive("door_open", TRUE) MakeSectorActive("door_open2", TRUE) else MakeSectorActive("door_open", FALSE) MakeSectorActive("door_open2", FALSE) end if vo.secret_door.opened then MakeSectorActive("axe_exit", TRUE) MakeSectorActive("secret_pass1", FALSE) MakeSectorActive("secret_pass2", FALSE) else MakeSectorActive("axe_exit", FALSE) end else MakeSectorActive("noax1", TRUE) MakeSectorActive("noax2", TRUE) MakeSectorActive("noax3", TRUE) MakeSectorActive("noax4", TRUE) MakeSectorActive("noax5", TRUE) MakeSectorActive("noax6", TRUE) MakeSectorActive("noax7", TRUE) MakeSectorActive("noax8", TRUE) MakeSectorActive("noax9", TRUE) MakeSectorActive("noax10", TRUE) MakeSectorActive("noax11", TRUE) end end vo.enter = function(arg1) -- line 681 NewObjectState(vo_intha, OBJSTATE_STATE, "vo_safe.bm", "vo_safe.zbm") vo.open_door:set_object_state("vo_door.cos") NewObjectState(vo_intha, OBJSTATE_STATE, "vo_secret.bm", "vo_secret.zbm") vo.secret_door:set_object_state("vo_secret.cos") if not vo_axe then vo_axe = Actor:create(nil, nil, nil, "axe") vo_axe.pos_x = -0.57863 vo_axe.pos_y = 1.52808 vo_axe.pos_z = 0 vo_axe.rot_x = 0 vo_axe.rot_y = 320 vo_axe.rot_z = 0 vo_axe.currentSet = system.currentSet end if vo_axe.currentSet == system.currentSet then vo_axe:put_in_set(vo) vo_axe:setpos(vo_axe.pos_x, vo_axe.pos_y, vo_axe.pos_z) vo_axe:setrot(vo_axe.rot_x, vo_axe.rot_y, vo_axe.rot_z) vo_axe:set_costume("mn_lift_ax.cos") vo_axe:play_chore(3) end vo:update_states() SetShadowColor(10, 10, 10) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 0, 0, 6000) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") end vo.exit = function(arg1) -- line 718 meche:free() KillActorShadows(manny.hActor) end vo.open_door = Object:create(vo, "/votx013/vault door", -0.35592201, 0.36448601, 0.3461, { range = 0.60000002 }) vo.open_door.use_pnt_x = -0.48652199 vo.open_door.use_pnt_y = 0.61648601 vo.open_door.use_pnt_z = 0 vo.open_door.use_rot_x = 0 vo.open_door.use_rot_y = 216.981 vo.open_door.use_rot_z = 0 vo.open_door.lookAt = function(arg1) -- line 737 manny:say_line("/voma014/") end vo.open_door.use = function(arg1) -- line 741 vo.close_safe() end vo.open_door.use_chisel = function(arg1) -- line 745 manny:say_line("/voma015/") end vo.wall_tab = Object:create(vo, "/votx016/metal tab", 0.14598399, 0.031533599, 0.58999997, { range = 0.80000001 }) vo.wall_tab.use_pnt_x = 0.095983997 vo.wall_tab.use_pnt_y = 0.15153401 vo.wall_tab.use_pnt_z = 0 vo.wall_tab.use_rot_x = 0 vo.wall_tab.use_rot_y = -6996.23 vo.wall_tab.use_rot_z = 0 vo.wall_tab.lookAt = function(arg1) -- line 757 soft_script() if vd.door_open then manny:say_line("/voma017/") else manny:say_line("/voma018/") end end vo.wall_tab.use = function(arg1) -- line 767 soft_script() manny:say_line("/voma019/") wait_for_message() manny:say_line("/voma020/") end vo.wall_tab.use_chisel = function(arg1) -- line 774 manny:say_line("/voma021/") end vo.wall_tab.pickUp = vo.wall_tab.use vo.wall_tab.use_scythe = function(arg1) -- line 780 if vd.door_open then START_CUT_SCENE() manny:walkto(-0.079353, 0.398622, 0, 0, -86.6857, 0) manny:wait_for_actor() manny:push_costume("mn_scythe_door.cos") manny:stop_chore(mn2_hold_scythe, "mn2.cos") manny:play_chore(mn_scythe_door_to_scythe_short) manny:wait_for_chore() manny:play_chore(mn_scythe_door_stop_scythe_short) manny:wait_for_chore() manny:pop_costume() manny:play_chore_looping(mn2_hold_scythe, "mn2.cos") END_CUT_SCENE() elseif vo.secret_door.opened then system.default_response("shed light") else start_script(vo.open_secret_door) end end vo.drawers1 = Object:create(vo, "/votx022/drawers", -1.2701401, 0.224554, 0.41, { range = 0.69999999 }) vo.drawers1.use_pnt_x = -1.32014 vo.drawers1.use_pnt_y = 0.59455401 vo.drawers1.use_pnt_z = 0 vo.drawers1.use_rot_x = 0 vo.drawers1.use_rot_y = -5622.98 vo.drawers1.use_rot_z = 0 vo.drawers1.lookAt = function(arg1) -- line 811 soft_script() manny:say_line("/voma023/") wait_for_message() manny:say_line("/voma024/") end vo.drawers1.use = function(arg1) -- line 818 soft_script() manny:say_line("/voma025/") wait_for_message() manny:say_line("/voma026/") end vo.drawers1.pickUp = vo.drawers1.use vo.drawers1.use_scythe = function(arg1) -- line 827 soft_script() manny:say_line("/voma028/") end vo.drawers1.use_chisel = function(arg1) -- line 832 START_CUT_SCENE() manny:walkto(-1.32288, 0.557319, 0, 0, 120, 0) manny:wait_for_actor() mn.chisel:use() manny:say_line("/voma029/") wait_for_message() manny:say_line("/voma030/") END_CUT_SCENE() end vo.drawers2 = Object:create(vo, "/votx031/drawers", -1.57014, 0.59455401, 0.80000001, { range = 1 }) vo.drawers2.use_pnt_x = -1.32014 vo.drawers2.use_pnt_y = 0.59455401 vo.drawers2.use_pnt_z = 0 vo.drawers2.use_rot_x = 0 vo.drawers2.use_rot_y = -5622.98 vo.drawers2.use_rot_z = 0 vo.drawers2.parent = vo.drawers1 vo.drawers3 = Object:create(vo, "/votx032/drawers", -1.61014, 0.94455397, 0.47999999, { range = 0.80000001 }) vo.drawers3.use_pnt_x = -1.32014 vo.drawers3.use_pnt_y = 0.59455401 vo.drawers3.use_pnt_z = 0 vo.drawers3.use_rot_x = 0 vo.drawers3.use_rot_y = -5677.6802 vo.drawers3.use_rot_z = 0 vo.drawers3.parent = vo.drawers1 vo.drawers4 = Object:create(vo, "/votx033/drawers", -1.23141, 2.04703, 0.40000001, { range = 0.69999999 }) vo.drawers4.use_pnt_x = -1.08946 vo.drawers4.use_pnt_y = 1.77124 vo.drawers4.use_pnt_z = 0 vo.drawers4.use_rot_x = 0 vo.drawers4.use_rot_y = 1146.3 vo.drawers4.use_rot_z = 0 vo.drawers4.parent = vo.drawers1 vo.suit = Object:create(vo, "/votx034/suit of armor", 0.041497, 1.7197, 0.68000001, { range = 0.80000001 }) vo.suit.use_pnt_x = -0.338503 vo.suit.use_pnt_y = 1.7596999 vo.suit.use_pnt_z = 0 vo.suit.use_rot_x = 0 vo.suit.use_rot_y = -5499.7402 vo.suit.use_rot_z = 0 vo.suit.lookAt = function(arg1) -- line 883 manny:say_line("/voma035/") end vo.suit.pickUp = function(arg1) -- line 887 manny:say_line("/voma036/") end vo.suit.use = function(arg1) -- line 891 if arg1.has_axe then vo.get_axe() elseif not vo.secret_door.opened then START_CUT_SCENE() soft_script() manny:walkto(-0.0789884, 1.60599, 0, 0, -43, 0) manny:wait_for_actor() manny:knock_on_door_anim() manny:say_line("/voma037/") wait_for_message() manny:say_line("/voma038/") wait_for_message() manny:say_line("/voma039/") END_CUT_SCENE() else manny:say_line("/voma040/") end end vo.suit.use_scythe = function(arg1) -- line 913 START_CUT_SCENE() manny:walkto(-0.361878, 1.74097, 0, 0, -60, 0) manny:play_chore(mn2_use_obj, "mn2.cos") manny:say_line("/voma041/") manny:wait_for_chore() manny:stop_chore(mn2_use_obj, "mn2.cos") END_CUT_SCENE() end vo.suit.use_chisel = function(arg1) -- line 923 manny:say_line("/voma042/") end vo.broadaxe = Object:create(vo, "/votx043/broadaxe", -0.57862997, 1.52808, 0, { range = 0.5 }) vo.broadaxe.use_pnt_x = -0.57862997 vo.broadaxe.use_pnt_y = 1.52808 vo.broadaxe.use_pnt_z = 0 vo.broadaxe.use_rot_x = 0 vo.broadaxe.use_rot_y = 320 vo.broadaxe.use_rot_z = 0 vo.broadaxe.lookAt = function(arg1) -- line 935 manny:say_line("/voma044/") end vo.broadaxe.pickUp = function(arg1) -- line 940 vo.get_axe() end vo.broadaxe.use = function(arg1) -- line 944 vo.get_axe() end vo.broadaxe.put_away = vo.broadaxe.use vo.broadaxe.default_response = vo.broadaxe.use vo.vd_door = Object:create(vo, "/votx045/door", -0.0043929298, -0.53289002, 0.41999999, { range = 0.80000001 }) vo.vd_door.use_pnt_x = 0.0096925097 vo.vd_door.use_pnt_y = 0.103199 vo.vd_door.use_pnt_z = 0 vo.vd_door.use_rot_x = 0 vo.vd_door.use_rot_y = -7021.1201 vo.vd_door.use_rot_z = 0 vo.vd_door.out_pnt_x = 0.0057194601 vo.vd_door.out_pnt_y = -0.1 vo.vd_door.out_pnt_z = 0 vo.vd_door.out_rot_x = 0 vo.vd_door.out_rot_y = -7021.1201 vo.vd_door.out_rot_z = 0 vo.vd_box = vo.vd_door vo.vd_door.walkOut = function(arg1) -- line 974 if vd.door_open then vd:come_out_door(vd.vo_door) vd:current_setup(vd_safex) else arg1:locked_out() end end vo.vd_door.locked_out = function(arg1) -- line 983 manny:say_line("/voma046/") end vo.vd_door.lookAt = function(arg1) -- line 987 if vd.door_open then manny:say_line("/voma047/") else arg1:locked_out() end end vo.secret_door = Object:create(vo, "/votx048/secret door", -1.64437, 1.08671, 0.47, { range = 0.60000002 }) vo.secret_door.use_pnt_x = -1.40437 vo.secret_door.use_pnt_y = 1.06671 vo.secret_door.use_pnt_z = 0 vo.secret_door.use_rot_x = 0 vo.secret_door.use_rot_y = -274.26501 vo.secret_door.use_rot_z = 0 vo.secret_door.out_pnt_x = -1.675 vo.secret_door.out_pnt_y = 1.03729 vo.secret_door.out_pnt_z = 0 vo.secret_door.out_rot_x = 0 vo.secret_door.out_rot_y = -273.17499 vo.secret_door.out_rot_z = 0 vo.secret_door:make_untouchable() vo.secret_door.lookAt = function(arg1) -- line 1012 manny:say_line("/voma049/") end vo.secret_door.use = function(arg1) -- line 1017 if manny_has_axe then vi:switch_to_set() manny:setpos(0.403806, -0.296262, 0) manny:setrot(0, -810, 0) manny:put_in_set(vi) vo_axe:put_in_set(vi) vo.broadaxe:make_untouchable() vi.broadaxe:make_touchable() else vi:come_out_door(vi.vo_door) end end vo.secret_door.walkOut = vo.secret_door.use CheckFirstTime("sg.lua") sg = Set:create("sg.set", "signpost fork", { sg_ovrhd = 0, sg_sgnha = 1, sg_sgnha2 = 1, sg_sgnha3 = 1, sg_sgnha4 = 1, sg_sgnha5 = 1, sg_spdws = 2, sg_mancu = 3 }) dofile("glottis_throws.lua") dofile("glottis_cry.lua") dofile("gl_saved.lua") dofile("ma_save_gl.lua") dofile("signpost.lua") dofile("ma_action_sign.lua") dofile("ma_climb_bw.lua") dofile("gl_boarding_bw.lua") dofile("bonewagon_gl.lua") rh = function() -- line 23 manny:default() sg:switch_to_set() start_script(sg.glottis_rip_heart) end glottis.snores = { } glottis.snores["/sggl001/"] = 0.2 glottis.snores["/sggl002/"] = 0.15000001 glottis.snores["/sggl003/"] = 0.039999999 glottis.snores["/sggl004/"] = 0.039999999 glottis.snores["/sggl005/"] = 0.15000001 glottis.snores["/sggl006/"] = 0.15000001 glottis.snores["/sggl007/"] = 0.15000001 glottis.snores["/sggl008/"] = 0.039999999 glottis.snores["/sggl009/"] = 0.039999999 glottis.snores["/sggl010/"] = 0.039999999 glottis.roars = { } glottis.roars[1] = { line = "/sggl011/", freq = 0.1, choreTbl = { bonewagon_gl_2vrm_lft, bonewagon_gl_vrm2drv } } glottis.roars[2] = { line = "/sggl012/", freq = 0.2, choreTbl = { bonewagon_gl_sc_hook, bonewagon_gl_sc_rmbl, bonewagon_gl_sc_rmbl, bonewagon_gl_sc2drv } } glottis.roars[3] = { line = "/sggl013/", freq = 0.1, choreTbl = { bonewagon_gl_sc_hook, bonewagon_gl_sc_rmbl, bonewagon_gl_sc2drv, bonewagon_gl_mck_shft } } glottis.roars[4] = { line = "/sggl014/", freq = 0.1, choreTbl = { bonewagon_gl_sc_hook, bonewagon_gl_sc2steer, bonewagon_gl_sc_steer, bonewagon_gl_sc2drv } } glottis.roars[5] = { line = "/sggl015/", freq = 0.1, choreTbl = { bonewagon_gl_rx2rmbl, bonewagon_gl_rx_rmbl, bonewagon_gl_rx_rmbl, bonewagon_gl_rx_2steer, bonewagon_gl_rx_steer, bonewagon_gl_rx_hook, bonewagon_gl_rx2drv } } glottis.roars[6] = { line = "/sggl016/", freq = 0.1, choreTbl = { bonewagon_gl_2rmbl, bonewagon_gl_rmbl2drv, bonewagon_gl_2rmbl, bonewagon_gl_rmbl2drv } } glottis.roars[7] = { line = "/sggl017/", freq = 0.1, choreTbl = { bonewagon_gl_sc_hook, bonewagon_gl_sc_rmbl, bonewagon_gl_sc2steer, bonewagon_gl_sc_steer, bonewagon_gl_sc2drv } } glottis.roars[8] = { line = "/sggl018/", freq = 0.1, choreTbl = { bonewagon_gl_rx2rmbl, bonewagon_gl_rx_rmbl, bonewagon_gl_rx_2steer, bonewagon_gl_rx_steer, bonewagon_gl_rx_hook, bonewagon_gl_rx2drv } } glottis.roars[9] = { line = "/sggl019/", freq = 0.050000001, choreTbl = { bonewagon_gl_sc_hook, bonewagon_gl_sc2steer, bonewagon_gl_sc_steer, bonewagon_gl_sc2drv } } glottis.roars[10] = { line = "/sggl020/", freq = 0.050000001, choreTbl = { bonewagon_gl_gl_2hands_out, bonewagon_gl_gl_cvr_eyes, bonewagon_gl_uncover_eyes, bonewagon_gl_gl_stop_hands_out } } sg.glottis_roars = function(arg1, arg2) -- line 69 local local1 local local2, local3, local4, local5 if not arg2 then arg2 = bonewagon end while TRUE do sleep_for(rndint(1000, 5000)) if cutSceneLevel <= 0 then local2 = random() local5 = 0 local3, local4 = next(glottis.roars, nil) local1 = nil while local3 and not local1 do local5 = local5 + local4.freq if local5 > local2 then local1 = local4 end local3, local4 = next(glottis.roars, local3) end if not local1 then local1 = glottis.roars[1] end if local1.choreTbl then start_script(sg.glottis_roars_animate, sg, arg2, local1.choreTbl) end arg2:say_line(local1.line, { skip_log = TRUE, background = TRUE, volume = 65 }) arg2:wait_for_message() wait_for_script(sg.glottis_roars_animate) end end end sg.glottis_roars_animate = function(arg1, arg2, arg3) -- line 106 local local1, local2, local3 local3 = bonewagon_gl_gl_drive local1, local2 = next(arg3, nil) while local1 do arg2:play_chore(local2) arg2:wait_for_chore(local2) local3 = local2 local1, local2 = next(arg3, local1) end arg2:stop_chore(local3) arg2:play_chore(bonewagon_gl_gl_drive) end signpost = Actor:create(nil, nil, nil, "Signpost") signpost.offset_vector = { x = -0.0211, y = 0.1585, z = 0 } signpost.manny_offset = { x = 0.15078799, y = 0.066618003, z = 0 } signpost.default = function(arg1) -- line 131 arg1:set_costume("signpost.cos") arg1:set_turn_rate(20) arg1:set_collision_mode(COLLISION_BOX, 0.3) end signpost.put_at_manny = function(arg1, arg2) -- line 137 local local1, local2, local3 local2 = manny:getrot() local1 = RotateVector(arg1.offset_vector, local2) local3 = manny:getpos() local1.x = local1.x + local3.x local1.y = local1.y + local3.y local1.z = local1.z + local3.z arg1:put_in_set(system.currentSet) arg1:setpos(local1.x, local1.y, local1.z) arg1:setrot(local2.x, local2.y - 110, local2.z) if not arg2 then arg1:show() end end signpost.get_manny_pos = function(arg1) -- line 154 local local1, local2, local3, local4 local2 = signpost:getrot() local1 = RotateVector(arg1.manny_offset, local2) local3 = signpost:getpos() local1.x = local1.x + local3.x local1.y = local1.y + local3.y local4 = manny:getpos() local1.z = local4.z return local1.x, local1.y, local1.z end signpost.get_future_manny_pos = function(arg1) -- line 168 local local1, local2, local3, local4, local5 local5 = manny:getrot() local3 = RotateVector(arg1.offset_vector, local5) local4 = manny:getpos() local3.x = local3.x + local4.x local3.y = local3.y + local4.y local3.z = local4.z arg1:setpos(local3.x, local3.y, local3.z) local2 = GetActorYawToPoint(arg1.hActor, system.currentSet.rubacava_point) local2 = { 0, local2, 0 } local1 = RotateVector(arg1.manny_offset, local2) local1.x = local1.x + local3.x local1.y = local1.y + local3.y local1.z = local3.z return local1.x, local1.y, local1.z end signpost.show = function(arg1) -- line 190 arg1:play_chore(signpost_show) arg1:set_collision_mode(COLLISION_BOX, 0.3) end signpost.hide = function(arg1) -- line 195 arg1:play_chore(signpost_hide) arg1:set_collision_mode(COLLISION_OFF) end signpost.pick_up = function(arg1) -- line 200 manny:push_costume("ma_action_sign.cos") manny:play_chore(ma_action_sign_lift_sign, "ma_action_sign.cos") sleep_for(500) start_sfx("sgSgnOut.WAV") sleep_for(150) arg1:hide() manny:wait_for_chore() manny:pop_costume() manny:play_chore_looping(ma_hold_sign, "ma.cos") end signpost.put_down = function(arg1) -- line 212 manny:stop_chore(ma_hold_sign, "ma.cos") manny:push_costume("ma_action_sign.cos") manny:play_chore(ma_action_sign_plant_sign, "ma_action_sign.cos") sleep_for(1300) start_sfx("sgSgnIn.WAV") sleep_for(960) arg1:put_at_manny() manny:wait_for_chore(ma_action_sign_plant_sign, "ma_action_sign.cos") manny:pop_costume() end sg.check_post = function(arg1, arg2) -- line 224 if manny.is_holding == sg.signpost then START_CUT_SCENE() if arg2 == sg.sp_door then manny:walkto(-2.83579, -4.87312, 0, 0, 5.9804, 0) manny:wait_for_actor() else manny:walkto_object(arg2) manny:wait_for_actor() end sg.signpost:plant() manny:wait_for_message() manny:say_line("/sgma040/") manny:wait_for_message() manny:say_line("/sgma041/") manny:wait_for_message() END_CUT_SCENE() return TRUE else return FALSE end end dofile("bonewagon.lua") sg.bw_out_points = { } sg.bw_out_points[0] = { pos = { x = -3.87446, y = -1.04915, z = 0 }, rot = { x = 0, y = 337.62799, z = 0 } } sg.bw_out_points[1] = { pos = { x = 0.26031801, y = 0.98607898, z = 0 }, rot = { x = 0, y = 236.30299, z = 0 } } sg.bw_out_points[2] = { pos = { x = 3.44713, y = -2.0948, z = 0 }, rot = { x = 0, y = 239.709, z = 0 } } sg.bw_out_points[3] = { pos = { x = 6.2069998, y = 0.25447601, z = 0 }, rot = { x = 0, y = 310.397, z = 0 } } bonewagon = Actor:create(nil, nil, nil, "Bone Wagon") bonewagon.max_walk_rate = 4.5 bonewagon.max_backward_rate = -3 bonewagon.max_turn_rate = 60 bonewagon.min_turn_rate = 0 bonewagon.going = FALSE bonewagon.keep_moving = FALSE bonewagon.is_backward = FALSE bonewagon.wheel_state = "center" bonewagon.max_volume = 30 bonewagon.glottis_offset_pos = { x = 0.76233, y = 0.34405601, z = 0 } bonewagon.glottis_offset_rot = { x = 0, y = 98.228401, z = 0 } bonewagon.manny_offset_pos = { x = 0.52359003, y = -1.335618, z = 0 } bonewagon.manny_offset_rot = { x = 0, y = 82.184402, z = 0 } bonewagon.manny_out_offset_pos = { x = 0.66830659, y = -1.518109, z = 0 } bonewagon.manny_out_offset_rot = { x = 0, y = 278.89801, z = 0 } bonewagon.manny_all_out_offset = { x = 0.97174299, y = -1.354003, z = 0 } bonewagon.rev_sfx = { "bwup01.WAV", "bwup02.WAV", "bwup04.wav", "bwup05.wav", "bwup06.wav" } bonewagon.down_sfx = { "bwdown02.WAV", "bwdown04.WAV", "bwdown06.WAV" } bonewagon.tire_sfx = { "bwTire01.WAV", "bwTire02.WAV", "bwTire03.WAV", "bwTire04.WAV" } bonewagon.cruise_sfx = { "bwrev05.wav", "bwrev07.wav", "bwrev09.wav", "bwrev12.wav" } bonewagon.default = function(arg1, arg2) -- line 287 arg1:follow_boxes() arg1:set_visibility(TRUE) if manny.is_driving then arg1:set_costume("bonewagon_gl.cos") arg1:play_chore(bonewagon_gl_ma_sit, "bonewagon_gl.cos") arg1:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") arg1:stop_chore(bonewagon_gl_stay_up, "bonewagon_gl.cos") arg1:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") arg1:set_collision_mode(COLLISION_SPHERE, 0.3) else arg1:set_costume("bonewagon_gl.cos") arg1:stop_chore(bonewagon_gl_stay_up, "bonewagon_gl.cos") arg1:play_chore(bonewagon_gl_no_shocks) arg1:set_collision_mode(COLLISION_BOX) end arg1.walk_rate = 0.5 arg1.turn_dir = 0 arg1.turn_rate = arg1.min_turn_rate arg1:set_walk_rate(arg1.walk_rate) arg1:set_turn_rate(arg1.turn_rate) arg1:set_talk_color(Orange) SetActorReflection(arg1.hActor, 50) end bonewagon.get_glottis_pos_rot = function(arg1) -- line 314 local local1, local2, local3, local4 local3 = arg1:get_positive_rot() local1 = RotateVector(arg1.glottis_offset_pos, local3) local4 = arg1:getpos() local1.x = local1.x + local4.x local1.y = local1.y + local4.y local1.z = local4.z newRot = arg1:get_positive_rot() newRot.y = newRot.y + arg1.glottis_offset_rot.y if newRot.y > 360 then newRot.y = newRot.y - 360 end if newRot.y < 0 then newRot.y = newRot.y + 360 end return local1, newRot end bonewagon.get_manny_pos = function(arg1, arg2) -- line 336 local local1, local2, local3 local2 = arg1:get_positive_rot() if not arg2 then local1 = RotateVector(arg1.manny_offset_pos, local2) else local1 = RotateVector(arg1.manny_out_offset_pos, local2) end local3 = arg1:getpos() local1.x = local1.x + local3.x local1.y = local1.y + local3.y local1.z = local3.z return local1.x, local1.y, local1.z end bonewagon.get_manny_far_pos = function(arg1) -- line 353 local local1, local2, local3 local2 = arg1:get_positive_rot() local1 = RotateVector(arg1.manny_all_out_offset, local2) local3 = arg1:getpos() local1.x = local1.x + local3.x local1.y = local1.y + local3.y local1.z = local3.z return local1.x, local1.y, local1.z end bonewagon.get_manny_rot = function(arg1, arg2) -- line 367 local local1 local1 = arg1:get_positive_rot() if not arg2 then local1.y = local1.y + arg1.manny_offset_rot.y else local1.y = local1.y + arg1.manny_out_offset_rot.y end if local1.y > 360 then local1.y = local1.y - 360 end if local1.y < 0 then local1.y = local1.y + 360 end return local1.x, local1.y, local1.z end bonewagon.accelerate = function(arg1, arg2, arg3) -- line 385 local local1 if not arg2 then arg2 = 0.1 end local1 = arg2 stop_script(arg1.decelerate) if not arg3 then while arg1.walk_rate < arg1.max_walk_rate do arg1.walk_rate = arg1.walk_rate + arg2 if arg1.walk_rate > arg1.max_walk_rate then arg1.walk_rate = arg1.max_walk_rate end arg1:set_walk_rate(arg1.walk_rate) arg2 = arg2 + local1 break_here() end else while arg1.walk_rate > arg1.max_backward_rate do arg1.walk_rate = arg1.walk_rate - arg2 if arg1.walk_rate < arg1.max_backward_rate then arg1.walk_rate = arg1.max_backward_rate end arg1:set_walk_rate(arg1.walk_rate) break_here() end end end bonewagon.decelerate = function(arg1, arg2, arg3) -- line 417 local local1 if not arg2 then arg2 = 0.1 end local1 = arg2 stop_script(arg1.accelerate) if not arg3 then while arg1.walk_rate > 1 do arg1.walk_rate = arg1.walk_rate - arg2 if arg1.walk_rate < 1 then arg1.walk_rate = 1 end arg1:set_walk_rate(arg1.walk_rate) arg2 = arg2 + local1 break_here() end else while arg1.walk_rate < 0 do arg1.walk_rate = arg1.walk_rate + arg2 if arg1.walk_rate > 0.1 then arg1.walk_rate = 0.1 end arg1:set_walk_rate(arg1.walk_rate) break_here() end end end bonewagon.cruise_sounds = function(arg1) -- line 449 fade_sfx("bwIdle.IMU", 1000, bonewagon.max_volume / 2) arg1.cur_cruise_sound = nil while TRUE do arg1.cur_cruise_sound = pick_one_of(bonewagon.cruise_sfx, TRUE) bonewagon:play_sound_at(arg1.cur_cruise_sound, 10, bonewagon.max_volume, IM_MED_PRIORITY) wait_for_sound(arg1.cur_cruise_sound) break_here() end end bonewagon.stop_cruise_sounds = function(arg1, arg2) -- line 460 local local1, local2 stop_script(arg1.cruise_sounds) local1, local2 = next(bonewagon.cruise_sfx, nil) while local1 do if sound_playing(local2) then fade_sfx(local2, 200) end local1, local2 = next(bonewagon.cruise_sfx, local1) end local1, local2 = next(bonewagon.rev_sfx, nil) while local1 do if sound_playing(local2) then fade_sfx(local2, 200) end local1, local2 = next(bonewagon.rev_sfx, local1) end local1, local2 = next(bonewagon.down_sfx, nil) while local1 do if sound_playing(local2) then fade_sfx(local2, 200) end local1, local2 = next(bonewagon.down_sfx, local1) end local1, local2 = next(bonewagon.tire_sfx, nil) while local1 do if sound_playing(local2) then fade_sfx(local2, 200) end local1, local2 = next(bonewagon.tire_sfx, local1) end if not arg2 then fade_sfx("bwIdle.IMU", 1000, bonewagon.max_volume) end end bonewagon.gas = function(arg1) -- line 499 local local1 stop_script(arg1.reverse, arg1) arg1.going = TRUE local1 = pick_one_of(bonewagon.rev_sfx, TRUE) bonewagon:play_sound_at(local1, 1, 10, IM_HIGH_PRIORITY) fade_sfx(local1, 500, bonewagon.max_volume) single_start_script(bonewagon.cruise_sounds, bonewagon) bonewagon:set_walk_chore(-1) bonewagon:set_turn_chores(-1, -1) bonewagon:set_rest_chore(-1) bonewagon:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") bonewagon:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") start_script(arg1.accelerate, arg1) while get_generic_control_state("MOVE_FORWARD") or arg1.keep_moving do WalkActorForward(arg1.hActor) break_here() end if sound_playing(local1) then fade_sfx(local1, 500, 0) end local1 = pick_one_of(bonewagon.down_sfx, TRUE) bonewagon:play_sound_at(local1, 10, bonewagon.max_volume, IM_HIGH_PRIORITY) start_script(arg1.decelerate, arg1) single_start_script(bonewagon.stop_cruise_sounds, bonewagon) while arg1.walk_rate > 1 do WalkActorForward(arg1.hActor) break_here() end fade_sfx(local1, 300, 0) arg1.going = FALSE end bonewagon.reverse = function(arg1) -- line 541 local local1 if find_script(arg1.gas) then stop_script(arg1.gas) arg1:brake() end arg1.going = TRUE start_script(arg1.accelerate, arg1, nil, TRUE) brakesfx = pick_one_of(bonewagon.tire_sfx, TRUE) single_start_sfx(brakesfx, IM_MED_PRIORITY, bonewagon.max_volume) bonewagon:set_walk_chore(-1) bonewagon:set_turn_chores(-1, -1) bonewagon:set_rest_chore(-1) bonewagon:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") bonewagon:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") while get_generic_control_state("MOVE_BACKWARD") or arg1.keep_moving do WalkActorForward(arg1.hActor) break_here() end start_script(arg1.decelerate, arg1, 0.5, TRUE) while arg1.walk_rate < 0 do WalkActorForward(arg1.hActor) break_here() end arg1.going = FALSE end bonewagon.brake = function(arg1, arg2) -- line 574 local local1, local2 stop_script(arg1.accelerate, arg1) if arg1.walk_rate > 0.1 then local2 = pick_one_of(bonewagon.down_sfx, TRUE) local1 = pick_one_of(bonewagon.tire_sfx, TRUE) if not arg2 then single_start_sfx(local2, IM_HIGH_PRIORITY, 0) fade_sfx(local2, 500, bonewagon.max_volume) end end single_start_script(arg1.decelerate, arg1, 0.30000001) bonewagon:set_walk_chore(-1) bonewagon:set_turn_chores(-1, -1) bonewagon:set_rest_chore(-1) bonewagon:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") bonewagon:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") while find_script(arg1.decelerate) do WalkActorForward(arg1.hActor) break_here() end if not arg2 then single_start_sfx(local1, IM_MED_PRIORITY, bonewagon.max_volume) end arg1.going = FALSE end bonewagon.left = function(arg1) -- line 611 if find_script(arg1.right) then stop_script(arg1.right) end if arg1.actual_walk_rate > 0.1 then single_start_sfx(pick_one_of(bonewagon.tire_sfx, TRUE), IM_LOW_PRIORITY, bonewagon.max_volume) end start_script(arg1.turn_wheels, arg1, "left") while get_generic_control_state("TURN_LEFT") do break_here() end if arg1.wheel_state == "left" then start_script(arg1.turn_wheels, arg1, "center") end end bonewagon.right = function(arg1) -- line 630 if find_script(arg1.left) then stop_script(arg1.left) end if arg1.actual_walk_rate > 0.1 then single_start_sfx(pick_one_of(bonewagon.tire_sfx, TRUE), IM_LOW_PRIORITY, bonewagon.max_volume) end start_script(arg1.turn_wheels, arg1, "right") while get_generic_control_state("TURN_RIGHT") do break_here() end if arg1.wheel_state == "right" then start_script(arg1.turn_wheels, arg1, "center") end end bonewagon.turn_wheels = function(arg1, arg2) -- line 649 if arg2 == "left" then arg1:stop_chore(bonewagon_gl_hold_rt, "bonewagon_gl.cos") arg1:stop_chore(bonewagon_gl_hold_ctr, "bonewagon_gl.cos") if arg1.wheel_state == "right" then arg1:play_chore(bonewagon_gl_rt_to_ctr, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_rt_to_ctr) arg1.wheel_state = "center" end if arg1.wheel_state == "center" then arg1:play_chore(bonewagon_gl_turn_lft, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_turn_lft) arg1:play_chore_looping(bonewagon_gl_hold_lft, "bonewagon_gl.cos") arg1.wheel_state = "left" end elseif arg2 == "center" then arg1:stop_chore(bonewagon_gl_hold_lft, "bonewagon_gl.cos") arg1:stop_chore(bonewagon_gl_hold_rt, "bonewagon_gl.cos") if arg1.wheel_state == "right" then arg1:play_chore(bonewagon_gl_rt_to_ctr, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_rt_to_ctr) arg1:play_chore_looping(bonewagon_gl_hold_ctr, "bonewagon_gl.cos") arg1.wheel_state = "center" end if arg1.wheel_state == "left" then arg1:play_chore(bonewagon_gl_lft_to_ctr, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_lft_to_ctr) arg1:play_chore_looping(bonewagon_gl_hold_ctr, "bonewagon_gl.cos") arg1.wheel_state = "center" end elseif arg2 == "right" then arg1:stop_chore(bonewagon_gl_hold_lft, "bonewagon_gl.cos") arg1:stop_chore(bonewagon_gl_hold_ctr, "bonewagon_gl.cos") if arg1.wheel_state == "left" then arg1:play_chore(bonewagon_gl_lft_to_ctr, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_lft_to_ctr) arg1.wheel_state = "center" end if arg1.wheel_state == "center" then arg1:play_chore(bonewagon_gl_turn_rt, "bonewagon_gl.cos") arg1:wait_for_chore(bonewagon_gl_turn_rt) arg1:play_chore_looping(bonewagon_gl_hold_rt, "bonewagon_gl.cos") arg1.wheel_state = "right" end end end bonewagon.walkto = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 696 bonewagon:set_walk_chore(-1) bonewagon:set_turn_chores(-1, -1) bonewagon:set_rest_chore(-1) if arg1.walk_rate < 1.5 or GetActorWalkRate(arg1.hActor) < 1.5 then arg1.walk_rate = 1.5 arg1:set_walk_rate(1.5) end bonewagon:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") Actor.walkto(arg1, arg2, arg3, arg4, arg5, arg6, arg7) end bonewagon.driveto = function(arg1, arg2, arg3, arg4, arg5) -- line 712 local local1 local local2 arg1:walkto(arg2, arg3, arg4) while arg1:is_moving() do local1 = proximity(bonewagon.hActor, arg2, arg3, arg4) arg1.walk_rate = min(arg1.max_walk_rate, local1) arg1.walk_rate = max(arg1.walk_rate, 1.5) arg1:set_walk_rate(arg1.walk_rate) if local1 < 1 and local2 == nil then arg1:stop_cruise_sounds() if not arg5 then local2 = pick_one_of(bonewagon.down_sfx, TRUE) arg1:play_sound_at(local2, 10, bonewagon.max_volume, IM_HIGH_PRIORITY) end end break_here() end arg1:wait_for_actor() end bonewagon.drivetorot = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 735 local local1, local2 arg1:stop_cruise_sounds() arg1.cur_cruise_sound = nil arg1:set_turn_rate(arg1.max_turn_rate / 2) arg1.walk_rate = 0.80000001 arg1:set_walk_rate(arg1.walk_rate) Actor.walkto(arg1, arg2, arg3, arg4) while arg1:is_moving() do local1 = proximity(bonewagon.hActor, arg2, arg3, arg4) if local1 > 0.5 then arg1.walk_rate = arg1.walk_rate + 0.2 else arg1.walk_rate = arg1.walk_rate - 0.2 end arg1.walk_rate = min(arg1.max_walk_rate, arg1.walk_rate) arg1.walk_rate = max(arg1.walk_rate, 1.5) arg1:set_walk_rate(arg1.walk_rate) if not arg1.cur_cruise_sound or not sound_playing(arg1.cur_cruise_sound) then arg1.cur_cruise_sound = pick_one_of(bonewagon.cruise_sfx, TRUE) arg1:play_sound_at(arg1.cur_cruise_sound, 10, bonewagon.max_volume, IM_MED_PRIORITY) end break_here() end arg1:stop_cruise_sounds() local2 = nil arg1:set_turn_rate(arg1.max_turn_rate / 3) Actor.setrot(arg1, arg5, arg6, arg7, TRUE) while arg1:is_turning() do if not local2 or not sound_playing(local2) then local2 = pick_one_of(bonewagon.tire_sfx, TRUE) arg1:play_sound_at(local2, 10, bonewagon.max_volume, IM_MED_PRIORITY) end break_here() end end bonewagon.monitor_turns = function(arg1) -- line 774 local local1, local2 local1 = arg1:getpos() arg1.actual_walk_rate = 0 while TRUE do arg1.turn_rate = abs(20 * arg1.actual_walk_rate) if arg1.turn_rate > arg1.max_turn_rate then arg1.turn_rate = arg1.max_turn_rate end arg1:set_turn_rate(arg1.turn_rate) if get_generic_control_state("TURN_LEFT") and cutSceneLevel <= 0 then if arg1.turn_rate > 1 then if arg1.walk_rate > 0 or get_generic_control_state("MOVE_FORWARD") then TurnActor(arg1.hActor, 1) else TurnActor(arg1.hActor, -1) end else if not bonewagon:playing_tire_sfx() then start_sfx(pick_one_of(bonewagon.tire_sfx, TRUE), IM_LOW_PRIORITY, bonewagon.max_volume) end arg1:set_turn_rate(30) TurnActor(arg1.hActor, 1) end elseif get_generic_control_state("TURN_RIGHT") and cutSceneLevel <= 0 then if arg1.turn_rate > 1 then if arg1.walk_rate > 0 or get_generic_control_state("MOVE_FORWARD") then TurnActor(arg1.hActor, -1) else TurnActor(arg1.hActor, 1) end else if not bonewagon:playing_tire_sfx() then start_sfx(pick_one_of(bonewagon.tire_sfx, TRUE), IM_LOW_PRIORITY, bonewagon.max_volume) end arg1:set_turn_rate(30) TurnActor(arg1.hActor, -1) end end break_here() local2 = proximity(arg1.hActor, local1.x, local1.y, local1.z) arg1.actual_walk_rate = local2 / system.frameTime * 1000 local1 = arg1:getpos() end end bonewagon.playing_tire_sfx = function(arg1) -- line 826 local local1, local2, local3 local1 = FALSE local2, local3 = next(arg1.tire_sfx, nil) while local2 and not local1 do if sound_playing(local3) then local1 = TRUE end local2, local3 = next(arg1.tire_sfx, local2) end return local1 end bonewagon.stop_movement_scripts = function(arg1) -- line 841 bonewagon:set_walk_chore(-1) bonewagon:set_turn_chores(-1, -1) bonewagon:set_rest_chore(-1) stop_script(bonewagon.gas) stop_script(bonewagon.reverse) stop_script(bonewagon.brake) stop_script(bonewagon.left) stop_script(bonewagon.right) stop_script(bonewagon.accelerate) stop_script(bonewagon.decelerate) bonewagon:play_chore(bonewagon_gl_gl_drive, "bonewagon_gl.cos") bonewagon:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") end bonewagon.squelch_sfx = function(arg1) -- line 856 local local1, local2 local1, local2 = next(bonewagon.rev_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume / 3) end local1, local2 = next(bonewagon.rev_sfx, local1) end local1, local2 = next(bonewagon.down_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume / 3) end local1, local2 = next(bonewagon.down_sfx, local1) end local1, local2 = next(bonewagon.tire_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume / 3) end local1, local2 = next(bonewagon.tire_sfx, local1) end local1, local2 = next(bonewagon.cruise_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume / 3) end local1, local2 = next(bonewagon.cruise_sfx, local1) end if sound_playing("bwIdle.IMU") then set_vol("bwIdle.IMU", bonewagon.max_volume / 3) end end bonewagon.restore_sfx = function(arg1) -- line 892 local local1, local2 local1, local2 = next(bonewagon.rev_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume) end local1, local2 = next(bonewagon.rev_sfx, local1) end local1, local2 = next(bonewagon.down_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume) end local1, local2 = next(bonewagon.down_sfx, local1) end local1, local2 = next(bonewagon.tire_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume) end local1, local2 = next(bonewagon.tire_sfx, local1) end local1, local2 = next(bonewagon.cruise_sfx, nil) while local1 do if sound_playing(local2) then set_vol(local2, bonewagon.max_volume) end local1, local2 = next(bonewagon.cruise_sfx, local1) end if sound_playing("bwIdle.IMU") then set_vol("bwIdle.IMU", bonewagon.max_volume) end end bonewagon.in_danger_box = function(arg1) -- line 928 return arg1:find_sector_name("no_bw_box") end bonewagon.can_get_out_here = function(arg1) -- line 935 local local1, local2, local3 local local4 = FALSE local1, local2, local3 = arg1:get_manny_far_pos() if GetPointSector(local1, local2, local3) then PrintDebug("Found point sector!\n") local4 = TRUE else PrintDebug("Failed point sector!\n") local4 = FALSE end if local4 then if signpost.current_set == system.currentSet then if proximity(signpost.hActor, local1, local2, local3) < 1 then PrintDebug("Failed signpost proximity!\n") local4 = FALSE end end end return local4 end bonewagon.find_safe_out_point = function(arg1) -- line 960 local local1 = system.currentSet.bw_out_points local local2, local3, local4 local local5, local6 if not bw_scout then bw_scout = Actor:create(nil, nil, nil, "bonewagon scout") end local2 = nil local5 = 9999 bw_scout.parent = arg1 bw_scout:set_visibility(FALSE) bw_scout:put_in_set(system.currentSet) if local1 then local3, local4 = next(local1, nil) while local3 do PrintDebug("Trying point " .. local4.pos.x .. ", " .. local4.pos.y .. ", " .. local4.pos.z .. "\n") local6 = proximity(arg1.hActor, local4.pos.x, local4.pos.y, local4.pos.z) bw_scout:setpos(local4.pos.x, local4.pos.y, local4.pos.z) bw_scout:setrot(local4.rot.x, local4.rot.y, local4.rot.z) if bw_scout:can_get_out_here() then if local6 < local5 then PrintDebug("Chosen!\n") local5 = local6 local2 = local3 else PrintDebug("Found better point.\n") end else PrintDebug("Failed.\n") end local3, local4 = next(local1, local3) end end return local2 end bonewagon.collision_handler = function(arg1, arg2) -- line 999 if arg2 == signpost then start_script(sg.signpost_collapse, sg) end end sg.signpost_collapse = function(arg1) -- line 1005 local local1, local2, local3 signpost:set_collision_mode(COLLISION_OFF) signpost.knocked_over = TRUE signpost.save_rot = signpost:get_positive_rot() local2 = copy_table(signpost.save_rot) local3 = bonewagon:get_positive_rot() local2.y = local3.y start_sfx("sgCrash.WAV", IM_HIGH_PRIORITY) if bonewagon.walk_rate < 0 or get_generic_control_state("MOVE_BACKWARD") then local1 = 10 while local2.x < 80 do local2.x = local2.x + local1 if local2.x > 80 then local2.x = 80 end signpost:setrot(local2.x, local2.y, local2.z) break_here() end else local1 = -10 while local2.x > -80 do local2.x = local2.x + local1 if local2.x < -80 then local2.x = -80 end signpost:setrot(local2.x, local2.y, local2.z) break_here() end end end sg.signpost_uncollapse = function(arg1) -- line 1041 local local1 = signpost:get_positive_rot() local local2 = signpost.save_rot local local3 if signpost.knocked_over then if proximity(bonewagon.hActor, signpost.hActor) > 2 then if signpost.current_set == system.currentSet then start_sfx("sgSgnSlw.WAV") wait_for_sound("sgSgnSlw.WAV") start_sfx("sgSgnStp.WAV") local3 = 10 while local3 ~= 0 do signpost:setrot(local2.x + local3, local2.y, local2.z) if local3 > 0 then local3 = floor(abs(local3 - 1)) else local3 = -floor(abs(local3 - 1)) end break_here() end end signpost:setrot(local2.x, local2.y, local2.z) signpost.knocked_over = FALSE system.currentSet.signpost:make_touchable() else system.currentSet.signpost:make_untouchable() end end end sg.examine_signpost = function(arg1) -- line 1074 local local1, local2 local local3, local4, local5 local local6 if sg.signpost.uprooted and sg:current_setup() ~= sg_spdws then START_CUT_SCENE() local1 = { } local1.pos = signpost:getpos() local1.rot = signpost:getrot() local2 = { } local2.pos = manny:getpos() local2.rot = manny:getrot() local6 = sg:current_setup() sg:current_setup(sg_mancu) signpost:setpos(4.0353198, -1.21448, 0) local3 = 3.8364899 + (local2.pos.x - local1.pos.x) local4 = -1.23856 + (local2.pos.y - local1.pos.y) local5 = 0 manny:ignore_boxes() manny:setpos(local3, local4, local5) if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(FALSE) bonewagon:set_collision_mode(COLLISION_OFF) end manny:head_look_at_point({ 4.0353198, -1.21448, 0.5 }) manny:say_line("/sgma051/") manny:wait_for_message() sleep_for(1000) sg:current_setup(local6) signpost:setpos(local1.pos.x, local1.pos.y, local1.pos.z) manny:follow_boxes() manny:setpos(local2.pos.x, local2.pos.y, local2.pos.z) manny:head_look_at(sg.signpost) if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(TRUE) bonewagon:set_collision_mode(COLLISION_BOX, 1) end END_CUT_SCENE() else manny:say_line("/sgma051/") end end bone_wagon_button_handler = function(arg1, arg2, arg3) -- line 1123 if cutSceneLevel <= 0 and not find_script(Sentence) then if control_map.PICK_UP[arg1] or control_map.USE[arg1] then if arg2 then single_start_script(sg.leave_BW, sg) end elseif control_map.MOVE_FORWARD[arg1] then if arg2 then if not find_script(bonewagon.gas) then start_script(bonewagon.gas, bonewagon) end end elseif control_map.MOVE_BACKWARD[arg1] then if arg2 then if not find_script(bonewagon.reverse) then start_script(bonewagon.reverse, bonewagon) end end elseif control_map.TURN_LEFT[arg1] then if arg2 then single_start_script(bonewagon.left, bonewagon) end elseif control_map.TURN_RIGHT[arg1] then if arg2 then single_start_script(bonewagon.right, bonewagon) end else CommonButtonHandler(arg1, arg2, arg3) end else CommonButtonHandler(arg1, arg2, arg3) end end sg.get_in_BW = function(arg1) -- line 1157 local local1, local2, local3 stop_script(sg.glottis_roars) stop_script(glottis.talk_randomly_from_weighted_table) if manny.is_holding == sg.signpost then sg.signpost:plant() end glottis.heartless = FALSE sg.glottis_obj:make_untouchable() inventory_disabled = TRUE START_CUT_SCENE() if not sg.bone_wagon.ridden then sg:switch_to_set() manny:set_collision_mode(COLLISION_OFF) glottis:set_collision_mode(COLLISION_OFF) bonewagon:set_collision_mode(COLLISION_OFF) signpost:set_collision_mode(COLLISION_OFF) sg:current_setup(sg_sgnha) glottis:set_costume(nil) glottis:put_in_set(sg) glottis:set_costume("gl_boarding_bw.cos") local1, local2 = bonewagon:get_glottis_pos_rot() glottis:setpos(local1.x, local1.y, local1.z) glottis:setrot(local2.x, local2.y, local2.z) manny:put_at_object(sg.bone_wagon) manny:head_look_at(glottis) IrisUp(300, 150, 1000) sleep_for(500) manny:say_line("/sgma021/") manny:wait_for_message() glottis:say_line("/sggl022/") glottis:wait_for_message() manny:set_visibility(FALSE) glottis:play_chore(gl_boarding_bw_hop_in_bw, "gl_boarding_bw.cos") bonewagon:play_chore(bonewagon_gl_ma_jump_in, "bonewagon_gl.cos") sleep_for(700) start_sfx("bwGlClmb.WAV") glottis:wait_for_chore(gl_boarding_bw_hop_in_bw, "gl_boarding_bw.cos") glottis:put_in_set(nil) bonewagon:play_chore(bonewagon_gl_drive, "bonewagon_gl.cos") sleep_for(1400) start_sfx("bwMaClmb.WAV") bonewagon:wait_for_chore(bonewagon_gl_ma_jump_in, "bonewagon_gl.cos") bonewagon:play_chore(bonewagon_gl_ma_sit, "bonewagon_gl.cos") else if system.currentSet == sg then sg:current_setup(sg_sgnha) end manny:walk_closeto_object(system.currentSet.bone_wagon, 0.80000001) manny:wait_for_actor() bonewagon:set_collision_mode(COLLISION_OFF) manny:set_collision_mode(COLLISION_OFF) manny:walkto_object(system.currentSet.bone_wagon) manny:wait_for_actor() manny:set_visibility(FALSE) bonewagon:play_chore(bonewagon_gl_ma_jump_in, "bonewagon_gl.cos") sleep_for(2100) start_sfx("bwMaClmb.WAV") bonewagon:wait_for_chore() bonewagon:play_chore(bonewagon_gl_ma_sit, "bonewagon_gl.cos") manny:put_in_set(nil) end start_sfx("bwStart.WAV", IM_HIGH_PRIORITY) sleep_for(200) start_sfx("bwIdle.IMU", IM_HIGH_PRIORITY, 0) fade_sfx("bwIdle.IMU", 1000, bonewagon.max_volume) sleep_for(500) if not sg.signpost.uprooted then sg.bone_wagon.ridden = TRUE sg.signpost.uprooted = TRUE sg:current_setup(sg_sgnha) sleep_for(1000) bonewagon:play_chore(bonewagon_gl_backup, "bonewagon_gl.cos") single_start_sfx(pick_one_of(bonewagon.tire_sfx, TRUE), IM_HIGH_PRIORITY, bonewagon.max_volume) start_sfx("bwrev01.wav", IM_HIGH_PRIORITY, bonewagon.max_volume) sleep_for(1700) fade_sfx("bwrev01.wav", 500) start_sfx("sgCrash.WAV", IM_HIGH_PRIORITY) sleep_for(200) start_script(sg.signpost_lean, sg) sleep_for(100) glottis:say_line("/gagl017/") bonewagon:wait_for_chore(bonewagon_gl_backup, "bonewagon_gl.cos") bonewagon:stop_chore(bonewagon_gl_backup, "bonewagon_gl.cos") bonewagon:setpos(-2.8169899, -3.0120001, 0) bonewagon:setrot(0, 39.022099, 0) bonewagon:play_chore(bonewagon_gl_no_shocks, "bonewagon_gl.cos") glottis:wait_for_message() bonewagon.walk_rate = 0.1 local3 = 0 while local3 < 100 do bonewagon:set_walk_rate(bonewagon.walk_rate) bonewagon.walk_rate = bonewagon.walk_rate + 0.1 bonewagon:walk_forward() break_here() local3 = local3 + system.frameTime end start_script(sg.signpost_vibrate, sg) start_sfx("bwrev01.wav", IM_HIGH_PRIORITY, bonewagon.max_volume) local3 = 0 while local3 < 200 do bonewagon:set_walk_rate(bonewagon.walk_rate) bonewagon.walk_rate = bonewagon.walk_rate + 0.2 bonewagon:walk_forward() break_here() local3 = local3 + system.frameTime end local3 = 0 bonewagon:set_turn_rate(10) while bonewagon.walk_rate > 0.1 and local3 < 2000 do bonewagon:set_walk_rate(bonewagon.walk_rate) bonewagon.walk_rate = bonewagon.walk_rate - 0.02 bonewagon:walk_forward() TurnActor(bonewagon.hActor, -1) break_here() local3 = local3 + system.frameTime end bonewagon.walk_rate = 0.1 bonewagon:set_walk_rate(bonewagon.walk_rate) glottis:say_line("/sugl165/") glottis:wait_for_message() end END_CUT_SCENE() bonewagon.current_set = nil if signpost.current_set == system.currentSet then signpost:set_collision_mode(COLLISION_BOX, 0.40000001) end system.currentSet.bone_wagon:make_untouchable() manny.is_driving = TRUE bonewagon:default() start_script(bonewagon.monitor_turns, bonewagon) sg:enable_bonewagon_boxes(TRUE) system.buttonHandler = bone_wagon_button_handler bonewagon:set_selected() manny:put_in_set(nil) music_state:set_state(stateOO_BONE) end sg.signpost_lean = function(arg1) -- line 1314 local local1 = 5 while local1 < 25 do SetActorPitch(signpost.hActor, local1) local1 = local1 + local1 / 2 break_here() end end sg.signpost_vibrate = function(arg1) -- line 1323 local local1 = 25 local local2 = 1 start_sfx("sgSgnStp.wav") while abs(local1) > 1 do SetActorPitch(signpost.hActor, local1 * local2) local1 = local1 - local1 / 6 local2 = -local2 break_here() end SetActorPitch(signpost.hActor, 0) end sg.park_BW_obj = function(arg1) -- line 1337 local local1 local local2 = { } bonewagon:stop_movement_scripts() bonewagon:wait_for_actor() bonewagon:stop_movement_scripts() local1 = bonewagon:getpos() system.currentSet.bone_wagon.obj_x = local1.x system.currentSet.bone_wagon.obj_y = local1.y system.currentSet.bone_wagon.obj_z = local1.z + 0.25 system.currentSet.bone_wagon.interest_actor:setpos(local1.x, local1.y, local1.z) local1 = { } local1.x, local1.y, local1.z = bonewagon:get_manny_pos() system.currentSet.bone_wagon.use_pnt_x = local1.x system.currentSet.bone_wagon.use_pnt_y = local1.y system.currentSet.bone_wagon.use_pnt_z = local1.z local2.x, local2.y, local2.z = bonewagon:get_manny_rot() system.currentSet.bone_wagon.use_rot_x = local2.x system.currentSet.bone_wagon.use_rot_y = local2.y system.currentSet.bone_wagon.use_rot_z = local2.z system.currentSet.bone_wagon:make_touchable() end sg.leave_BW = function(arg1, arg2) -- line 1364 local local1, local2, local3 START_CUT_SCENE() stop_script(bonewagon.gas) stop_script(bonewagon.reverse) stop_script(bonewagon.left) stop_script(bonewagon.right) bonewagon:brake(TRUE) END_CUT_SCENE() if not arg2 then if system.currentSet.enable_bonewagon_boxes then system.currentSet:enable_bonewagon_boxes(FALSE) end if not bonewagon:can_get_out_here() then if system.currentSet.enable_bonewagon_boxes then system.currentSet:enable_bonewagon_boxes(TRUE) end local1 = bonewagon:find_safe_out_point() if local1 then system.default_response("not here") local1 = system.currentSet.bw_out_points[local1] bonewagon:drivetorot(local1.pos.x, local1.pos.y, local1.pos.z, local1.rot.x, local1.rot.y, local1.rot.z) bonewagon:wait_for_actor() else system.default_response("no room") return end end end bonewagon:stop_cruise_sounds(TRUE) fade_sfx("bwIdle.IMU", 1000, 0) if system.currentSet.enable_bonewagon_boxes then system.currentSet:enable_bonewagon_boxes(FALSE) end sg:park_BW_obj() manny.is_driving = FALSE stop_script(bonewagon.monitor_turns) system.buttonHandler = SampleButtonHandler START_CUT_SCENE() bonewagon:play_chore(bonewagon_gl_ma_jump_out, "bonewagon_gl.cos") bonewagon:wait_for_chore(bonewagon_gl_ma_jump_out, "bonewagon_gl.cos") bonewagon:set_collision_mode(COLLISION_OFF) manny:set_collision_mode(COLLISION_OFF) manny:put_in_set(system.currentSet) local1, local2, local3 = bonewagon:get_manny_pos(TRUE) manny:setpos(local1, local2, local3) local1, local2, local3 = bonewagon:get_manny_rot(TRUE) manny:setrot(local1, local2, local3) manny:set_selected() manny:set_visibility(TRUE) bonewagon:play_chore(bonewagon_gl_hide_ma, "bonewagon_gl.cos") local1 = 0 while local1 < 1000 do manny:walk_forward() break_here() local1 = local1 + system.frameTime end manny:set_collision_mode(COLLISION_SPHERE, 0.5) bonewagon:set_collision_mode(COLLISION_BOX, 1) END_CUT_SCENE() inventory_disabled = FALSE bonewagon.current_set = system.currentSet bonewagon.current_pos = bonewagon:getpos() bonewagon.current_rot = bonewagon:getrot() bonewagon:stop_cruise_sounds(TRUE) start_script(sg.signpost_uncollapse, sg) single_start_script(sg.glottis_roars, sg) music_state:update(system.currentSet) end sg.enable_bonewagon_boxes = function(arg1, arg2) -- line 1448 local local1, local2 local1 = 1 while local1 <= 17 do local2 = "bw_box" .. local1 MakeSectorActive(local2, arg2) local1 = local1 + 1 end local1 = 1 while local1 <= 22 do local2 = "mn_box" .. local1 MakeSectorActive(local2, not arg2) local1 = local1 + 1 end if not arg2 then local1 = not sg.glottis_obj.touchable MakeSectorActive("glot_box1", local1) MakeSectorActive("glot_box2", local1) MakeSectorActive("glot_box3", local1) MakeSectorActive("no_glot_box1", sg.glottis_obj.touchable) MakeSectorActive("no_glot_box2", sg.glottis_obj.touchable) MakeSectorActive("no_glot_box3", sg.glottis_obj.touchable) else MakeSectorActive("glot_box1", FALSE) MakeSectorActive("glot_box2", FALSE) MakeSectorActive("glot_box3", FALSE) MakeSectorActive("no_glot_box1", FALSE) MakeSectorActive("no_glot_box2", FALSE) MakeSectorActive("no_glot_box3", FALSE) end MakeSectorActive("sg_sp_box_bw", arg2) MakeSectorActive("sg_sm_box_bw", arg2) end sg.update_glottis = function(arg1) -- line 1492 stop_script(sg.glottis_roars) stop_script(glottis.talk_randomly_from_weighted_table) ExpireText() if glottis.ripped_heart then if glottis.heartless then glottis:default() glottis:put_in_set(sg) glottis:ignore_boxes() glottis:setpos(-2.76674, -4.90863, 0) glottis:setrot(0, 41.4323, 0) glottis:push_costume("glottis_throws.cos") glottis:play_chore(glottis_throws_sleep) if not find_script(glottis.talk_randomly_from_weighted_table) then start_script(glottis.talk_randomly_from_weighted_table, glottis, glottis.snores) end MakeSectorActive("glot_box1", FALSE) MakeSectorActive("glot_box2", FALSE) MakeSectorActive("glot_box3", FALSE) MakeSectorActive("no_glot_box1", TRUE) MakeSectorActive("no_glot_box2", TRUE) MakeSectorActive("no_glot_box3", TRUE) else sg.glottis_obj:make_untouchable() if not manny.is_driving then MakeSectorActive("glot_box1", TRUE) MakeSectorActive("glot_box2", TRUE) MakeSectorActive("glot_box3", TRUE) end MakeSectorActive("no_glot_box1", FALSE) MakeSectorActive("no_glot_box2", FALSE) MakeSectorActive("no_glot_box3", FALSE) glottis:free() glottis:put_in_set(nil) if bonewagon.current_set == sg and not manny.is_driving then single_start_script(sg.glottis_roars, sg, bonewagon) end end else MakeSectorActive("glot_box1", TRUE) MakeSectorActive("glot_box2", TRUE) MakeSectorActive("glot_box3", TRUE) MakeSectorActive("no_glot_box1", FALSE) MakeSectorActive("no_glot_box2", FALSE) MakeSectorActive("no_glot_box3", FALSE) end end sg.glottis_rip_heart = function(arg1) -- line 1546 glottis.ripped_heart = TRUE glottis.heartless = TRUE sp.web.contains = sp.heart START_CUT_SCENE() music_state:set_sequence(seqGlottisHeart) set_override(sg.glottis_rip_heart_override, sg) sg:current_setup(sg_sgnha) LoadCostume("glottis_throws.cos") LoadCostume("glottis_cry.cos") manny:setpos(-5.56994, -4.63949, 0) manny:setrot(0, 306.939, 0) glottis:default() glottis:put_in_set(sg) glottis:push_costume("glottis_cry.cos") glottis:ignore_boxes() glottis:setpos(-2.76674, -4.90863, 0) glottis:setrot(0, 41.4323, 0) glottis:play_chore_looping(glottis_cry_cry_cyc, "glottis_cry.cos") sg:current_setup(sg_sgnha) manny:walkto(-5.19219, -4.35516, 0) glottis:say_line("/sggl023/") manny:wait_for_actor() manny:setrot(0, 274.838, 0) glottis:wait_for_message() glottis:say_line("/sggl024/") manny:walkto(-3.36409, -4.55001, 0) sleep_for(500) sg:current_setup(sg_spdws) manny:setpos(-3.75837, -4.61657, 0) manny:setrot(0, 263.997, 0) manny:walkto(-3.46798, -4.64709, 0, 0, 263.962, 0) manny:wait_for_actor() manny:turn_toward_entity(-2.6755, -4.83566, 0) manny:head_look_at_point(-2.98244, -4.81335, 0.552) glottis:wait_for_message() manny:hand_gesture() manny:say_line("/sgma025/") manny:wait_for_message() manny:shrug_gesture() manny:say_line("/sgma026/") glottis:set_chore_looping(glottis_cry_cry_cyc, FALSE, "glottis_cry.cos") glottis:wait_for_chore("glottis_cry_cry_cyc", "glottis_cry.cos") glottis:play_chore(glottis_cry_cry_out, "glottis_cry.cos") manny:wait_for_message() glottis:say_line("/sggl027/") glottis:wait_for_message() glottis:play_chore(glottis_cry_head_swing_in, "glottis_cry.cos") glottis:say_line("/sggl028/") glottis:wait_for_chore(glottis_cry_head_swing_in, "glottis_cry.cos") glottis:play_chore_looping(glottis_cry_head_swing_cyc, "glottis_cry.cos") wait_for_message() glottis:set_chore_looping(glottis_cry_head_swing_cyc, FALSE, "glottis_cry.cos") glottis:say_line("/sggl029/") glottis:wait_for_chore(glottis_cry_head_swing_cyc, "glottis_cry.cos") glottis:play_chore(glottis_cry_head_swing_out, "glottis_cry.cos") glottis:wait_for_chore(glottis_cry_head_swing_out, "glottis_cry.cos") sleep_for(500) glottis:say_line("/sggl023/") glottis:play_chore(glottis_cry_tantrum_in, "glottis_cry.cos") glottis:wait_for_chore(glottis_cry_tantrum_in, "glottis_cry.cos") glottis:play_chore_looping(glottis_cry_tantrum_cyc, "glottis_cry.cos") wait_for_message() manny:say_line("/sgma030/") glottis:set_chore_looping(glottis_cry_tantrum_cyc, FALSE, "glottis_cry.cos") glottis:wait_for_chore(glottis_cry_tantrum_cyc, "glottis_cry.cos") glottis:play_chore_looping(glottis_cry_tantrum_out, "glottis_cry.cos") wait_for_message() glottis:wait_for_chore(glottis_cry_tantrum_out, "glottis_cry.cos") glottis:stop_chore() glottis:push_costume("glottis_throws.cos") glottis:play_chore(glottis_throws_throws, "glottis_throws.cos") glottis:say_line("/sggl031/") wait_for_message() glottis:say_line("/sggl032/") wait_for_message() glottis:say_line("/sggl034/") wait_for_message() glottis:say_line("/sggl035/") wait_for_message() glottis:say_line("/sggl036/") wait_for_message() glottis:wait_for_chore() glottis:play_chore(glottis_throws_sleep, "glottis_throws.cos") break_here() manny:say_line("/sgma038/") sleep_for(500) start_script(manny.walkto_object, manny, sg.glottis_obj) manny:wait_for_message() manny:wait_for_actor() glottis:wait_for_message() manny:twist_head_gesture() manny:say_line("/sgma039/") break_here() manny:wait_for_message() END_CUT_SCENE() start_script(cut_scene.sp06a, cut_scene) wait_for_script(cut_scene.sp06a) wait_for_message() sg:update_glottis() end sg.glottis_rip_heart_override = function(arg1) -- line 1669 kill_override() sg:switch_to_set() sg:current_setup(sg_spdws) manny:shut_up() glottis:stop_chore() glottis:shut_up() manny:default() manny:put_at_object(sg.glottis_obj) if not find_script(glottis.talk_randomly_from_weighted_table) then start_script(glottis.talk_randomly_from_weighted_table, glottis, glottis.snores) end sg:update_glottis() end sg.replace_heart = function() -- line 1685 cur_puzzle_state[11] = TRUE sg.heart:put_in_limbo() sg.glottis_obj:make_untouchable() glottis.heartless = FALSE sg.bone_wagon.contains = glottis stop_script(glottis.talk_randomly_from_weighted_table) set_override(sg.replace_heart_override) START_CUT_SCENE() manny:walkto(-2.23264, -4.77272, 0, 0, 131.467, 0) manny:wait_for_actor() MakeSectorActive("glot_box1", TRUE) MakeSectorActive("glot_box2", TRUE) manny:walkto(-2.23264, -4.77272, 0, 0, 131.467, 0) manny:wait_for_actor() manny:stop_chore(ma_activate_heart, "ma.cos") manny:stop_chore(ma_hold, "ma.cos") manny:push_costume("ma_save_gl.cos") glottis:shut_up() glottis:stop_chore() glottis:pop_costume() glottis:push_costume("gl_saved.cos") glottis:head_look_at(nil) glottis:play_chore(gl_saved_saved, "gl_saved.cos") manny:play_chore(ma_save_gl_save_glottis, "ma_save_gl.cos") sleep_for(2000) stop_sound("glHrtBt.IMU") start_sfx("sgHrtShv.wav") sleep_for(4000) glottis:say_line("/cpdgl12a/") wait_for_message() glottis:say_line("/cpdgl12b/") wait_for_message() glottis:say_line("/cpdgl12c/") wait_for_message() glottis:say_line("/cpdgl12d/") wait_for_message() glottis:say_line("/cpdgl12e/") wait_for_message() glottis:say_line("/cpdgl12f/") wait_for_message() glottis:wait_for_chore() manny:wait_for_chore() IrisDown(320, 240, 1000) sleep_for(1500) manny:pop_costume() glottis:pop_costume() glottis:default() END_CUT_SCENE() inventory_disabled = FALSE start_script(cut_scene.copaldie, cut_scene) end sg.replace_heart_override = function() -- line 1747 kill_override() manny:stop_chore() manny:stop_chore(ma_activate_heart, "ma.cos") manny:stop_chore(ma_hold, "ma.cos") manny:pop_costume() glottis:shut_up() glottis:stop_chore() glottis:pop_costume() stop_sound("glHrtBt.IMU") glottis:default() start_script(sg.get_in_BW) end sg.rubacava_point = { x = 2.138, y = 12.1412, z = 0 } sg.enter = function(arg1) -- line 1769 sg:update_glottis() manny:set_collision_mode(COLLISION_SPHERE, 0.4) if sg.signpost.touchable and signpost.current_set == arg1 then sg.signpost:make_visible() end if not sg.bone_wagon.ridden then bonewagon:default() bonewagon:put_in_set(arg1) bonewagon:setpos(2.88665, -0.798663, 0) bonewagon:setrot(0, 219.129, 0) end if bonewagon.current_set == arg1 then bonewagon:put_in_set(arg1) bonewagon:setpos(bonewagon.current_pos.x, bonewagon.current_pos.y, bonewagon.current_pos.z) bonewagon:setrot(bonewagon.current_rot.x, bonewagon.current_rot.y, bonewagon.current_rot.z) if not manny.is_driving then single_start_script(sg.glottis_roars, sg, bonewagon) end end if not manny.is_driving then sg:enable_bonewagon_boxes(FALSE) else sg:enable_bonewagon_boxes(TRUE) end if sg.heart.touchable then preload_sfx("sgGetHrt.wav") preload_sfx("sgHrtShv.wav") sg.heart:make_touchable() start_sfx("glHrtBt.imu", IM_HIGH_PRIORITY, sp.heartbeat_vol_medium) else sg.heart:make_untouchable() end if manny.is_driving then bonewagon:default() single_start_sfx("bwIdle.IMU", IM_HIGH_PRIORITY, 0) fade_sfx("bwIdle.IMU", 1000, bonewagon.max_volume) end sg:add_ambient_sfx({ "frstCrt1.wav", "frstCrt2.wav", "frstCrt3.wav", "frstCrt4.wav" }, { min_delay = 8000, max_delay = 20000 }) end sg.camerachange = function(arg1, arg2, arg3) -- line 1820 if arg3 == sg_spdws then if manny.is_driving or bonewagon:in_danger_box() then sg:current_setup(arg2) end end if signpost.current_set == sg and manny.is_holding ~= sg.signpost then if arg3 == sg_spdws then signpost:play_chore(signpost_show) else signpost:play_chore(signpost_show_lit) end end if sound_playing("glHrtBt.imu") then if arg3 == sg_spdws then set_vol("glHrtBt.imu", sp.heartbeat_vol_medium) else set_vol("glHrtBt.imu", sp.heartbeat_vol_far) end end end sg.update_music_state = function(arg1) -- line 1855 if manny.is_driving then return stateOO_BONE else return stateSG end end sg.exit = function(arg1) -- line 1863 manny:set_collision_mode(COLLISION_OFF) if sg.heart.visible_actor then sg.heart.visible_actor:free() end stop_script(glottis.talk_randomly_from_weighted_table) stop_script(sg.glottis_roars) glottis:shut_up() glottis:free() bonewagon:shut_up() stop_sound("bwIdle.IMU") stop_sound("glHrtBt.imu") end sg.glottis_obj = Object:create(sg, "/sgtx043/Glottis", -2.4567201, -5.0476298, 0.3705, { range = 2 }) sg.glottis_obj.use_pnt_x = -2.23264 sg.glottis_obj.use_pnt_y = -4.7727199 sg.glottis_obj.use_pnt_z = 0 sg.glottis_obj.use_rot_x = 0 sg.glottis_obj.use_rot_y = 131.467 sg.glottis_obj.use_rot_z = 0 sg.glottis_obj.lookAt = function(arg1) -- line 1898 end sg.glottis_obj.pickUp = function(arg1) -- line 1901 end sg.glottis_obj.use = function(arg1) -- line 1904 end sg.glottis_obj.lookAt = function(arg1) -- line 1907 if glottis.heartless then manny:say_line("/sgma044/") else sg.bone_wagon:lookAt() end end sg.glottis_obj.pickUp = function(arg1) -- line 1915 manny:say_line("/sgma045/") end sg.glottis_obj.use = function(arg1) -- line 1919 if glottis.heartless then manny:say_line("/sgma046/") else sg:get_in_BW() end end sg.glottis_obj.use_heart = function(arg1) -- line 1927 start_script(sg.replace_heart) end sg.glottis_obj.use_scythe = function(arg1) -- line 1931 START_CUT_SCENE() manny:say_line("/sgma047/") manny:wait_for_message() manny:say_line("/sgma048/") END_CUT_SCENE() end sg.glottis_obj.use_bone = function(arg1) -- line 1939 manny:say_line("/sgma049/") end sg.signpost = Object:create(sg, "/sgtx050/sign post", -1.87272, -4.17906, 0.60000002, { range = 1.5 }) sg.signpost.use_pnt_x = -1.71085 sg.signpost.use_pnt_y = -4.1479301 sg.signpost.use_pnt_z = 0 sg.signpost.use_rot_x = 0 sg.signpost.use_rot_y = 2617.03 sg.signpost.use_rot_z = 0 sg.signpost.uprooted = FALSE sg.signpost.used_once = FALSE sg.signpost.default_rot = { x = 0, y = 346.20999, z = 0 } sg.signpost.can_put_away = FALSE signpost.current_set = sg signpost.current_pos = { x = -1.87272, y = -4.17906, z = 0 } signpost.current_rot = { x = 0, y = 346.20999, z = 0 } sg.signpost.lookAt = function(arg1) -- line 1962 system.currentSet:examine_signpost() end sg.signpost.put_away = function(arg1) -- line 1966 system.default_response("not now") return FALSE end sg.signpost.pickUp = function(arg1) -- line 1975 if arg1.uprooted then if manny:walk_closeto_object(arg1, 0.8) then cur_puzzle_state[12] = TRUE START_CUT_SCENE() arg1.used_once = TRUE manny:wait_for_actor() signpost:set_collision_mode(COLLISION_OFF) manny:walkto_object(arg1) manny:wait_for_actor() signpost:pick_up() sg.signpost:get() manny.is_holding = arg1 sg.signpost:make_untouchable() END_CUT_SCENE() signpost.current_set = nil else system.default_repsonse("reach") end elseif manny:walk_closeto_object(arg1, 0.8) then START_CUT_SCENE() manny:wait_for_actor() signpost:set_collision_mode(COLLISION_OFF) manny:walkto_object(arg1) manny:wait_for_actor() manny:push_costume("ma_action_sign.cos") manny:play_chore(ma_action_sign_try_to_lift, "ma_action_sign.cos") manny:wait_for_chore() manny:pop_costume() manny:say_line("/sgma052/") signpost:set_collision_mode(COLLISION_BOX, 0.3) END_CUT_SCENE() else system.default_response("reach") end end sg.signpost.plant = function(arg1) -- line 2014 local local1, local2, local3 local local4 local local5, local6 local local7 local local8 = FALSE local local9, local10, local11 if bonewagon.current_set == system.currentSet then local9, local10, local11 = bonewagon:get_manny_far_pos() if proximity(manny.hActor, bonewagon.hActor) < 2 or proximity(manny.hActor, local9, local10, local11) < 1.5 then system.default_response("not here") manny:wait_for_message() manny:say_line("/sgma065/") return FALSE end end local3 = { } local3.x, local3.y, local3.z = signpost:get_future_manny_pos() if not GetPointSector(local3.x, local3.y, local3.z) then system.default_response("no room") return FALSE end START_CUT_SCENE() arg1:free() manny.is_holding = nil inventory_disabled = FALSE if system.currentSet == na or (system.currentSet == sg and sg:current_setup() ~= sg_spdws) then local7 = { } local7.pos = manny:getpos() local7.rot = manny:getrot() signpost:put_at_manny(TRUE) local7.signpos = signpost:getpos() local7.destangle = GetActorYawToPoint(signpost.hActor, system.currentSet.rubacava_point) if system.currentSet == na then na:current_setup(na_mancu) else sg:current_setup(sg_mancu) end if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(FALSE) bonewagon:set_collision_mode(COLLISION_OFF) end manny:setpos(3.8364899, -1.23856, 0.5) end signpost:put_down() signpost:play_chore(signpost_show) if system.currentSet == sg then local4 = arg1 else local4 = na.signpost end signpost:set_collision_mode(COLLISION_OFF) manny:backup(500) signpost:set_collision_mode(COLLISION_BOX, 0.30000001) if system.currentSet == na then if na:check_for_nav_solved(local7.signpos) then local8 = TRUE end end if not local8 then if local7 then sg.signpost:spin(system.currentSet.rubacava_point, local7.destangle) manny:setrot(0, local7.destangle, 0, TRUE) manny:wait_for_actor() sleep_for(1000) local1 = signpost:getpos() local3 = manny:getpos() if system.currentSet == sg then sg:current_setup(sg_sgnha) else na:current_setup(na_intha) end if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(TRUE) bonewagon:set_collision_mode(COLLISION_BOX, 1) end signpost:play_chore(signpost_show_lit) signpost:setpos(local7.signpos.x, local7.signpos.y, local7.signpos.z) local3.x = local7.signpos.x - (local1.x - local3.x) local3.y = local7.signpos.y - (local1.y - local3.y) local3.z = local7.signpos.z manny:setpos(local3.x, local3.y, local3.z) signpost:setrot(0, local7.destangle, 0) else sg.signpost:spin(system.currentSet.rubacava_point) if system.currentSet == sg and sg:current_setup() ~= sg_spdws then signpost:play_chore(signpost_show_lit) end end local4.interest_actor:put_in_set(system.currentSet) local1 = signpost:getpos() local4.obj_x = local1.x local4.obj_y = local1.y local4.obj_z = local1.z + 0.60000002 local4.interest_actor:setpos(local4.obj_x, local4.obj_y, local4.obj_z) local4:make_touchable() local4.use_pnt_x, local4.use_pnt_y, local4.use_pnt_z = signpost:get_manny_pos() local2 = signpost:getrot() local4.use_rot_x = local2.x local4.use_rot_y = local2.y + 110 local4.use_rot_z = local2.z signpost:set_collision_mode(COLLISION_BOX, 0.30000001) end END_CUT_SCENE() if not local8 then signpost.current_set = system.currentSet signpost.current_pos = signpost:getpos() signpost.current_rot = signpost:getrot() end return TRUE end sg.signpost.spin = function(arg1, arg2, arg3) -- line 2146 local local1 local local2, local3 local local4, local5 local1 = signpost:getrot() while local1.y > 360 do local1.y = local1.y - 360 end while local1.y < 0 do local1.y = local1.y + 360 end local2 = 0 local3 = 1 start_sfx("sgSgnRot.IMU") while local2 < 5 do local1.y = local1.y + local3 if local3 < 40 then local3 = local3 + 1 end if local1.y > 360 then local1.y = local1.y - 360 local2 = local2 + 1 end signpost:setrot(local1.x, local1.y, local1.z) break_here() end if not arg3 then arg3 = GetActorYawToPoint(signpost.hActor, arg2) end while arg3 > 360 do arg3 = arg3 - 360 end while arg3 < 0 do arg3 = arg3 + 360 end fade_sfx("sgSgnRot.IMU", 200, 0) start_sfx("sgSgnSlw.WAV", 127, 0) fade_sfx("sgSgnSlw.WAV", 200, 127) while local3 > 1 do local1.y = local1.y + local3 local3 = local3 - local3 / 4 if local1.y > 360 then local1.y = local1.y - 360 end signpost:setrot(local1.x, local1.y, local1.z) break_here() end stop_sound("sgSgnRot.IMU") local3 = 1 local4 = arg3 if local4 > local1.y then local4 = local4 - 360 end local5 = 0 while local1.y > local4 do local1.y = local1.y - local3 local3 = local3 + local3 / 2 signpost:setrot(local1.x, local1.y, local1.z) break_here() local5 = local5 + system.frameTime if local5 >= 150 then single_start_sfx("sgSgnStp.WAV") end end if local5 < 100 then single_start_sfx("sgSgnStp.WAV") end if abs(local1.y - local4) < local3 then local3 = abs(local1.y - local4) end while abs(local1.y - local4) > 1 do local3 = local3 - local3 / 3 if local1.y > local4 then local1.y = local4 - local3 else local1.y = local4 + local3 end signpost:setrot(local1.x, local1.y, local1.z) break_here() end signpost:setrot(0, arg3, 0) end sg.signpost.use = function(arg1) -- line 2243 if manny.is_holding == arg1 then arg1:plant() else sg.signpost:pickUp() end end sg.signpost.use_scythe = function(arg1) -- line 2251 if arg1.uprooted then manny:say_line("/sgma054/") else manny:say_line("/sgma055/") manny:wait_for_message() manny:say_line("/sgma056/") end end sg.signpost.make_visible = function(arg1) -- line 2261 signpost:default() signpost:put_in_set(system.currentSet) signpost:setpos(signpost.current_pos.x, signpost.current_pos.y, signpost.current_pos.z) signpost:setrot(signpost.current_rot.x, signpost.current_rot.y, signpost.current_rot.z) signpost:play_chore(signpost_show, "signpost.cos") end sg.heart = Object:create(sg, "/sgtx057/heart", -2.80985, -4.17379, 0.073100001, { range = 1 }) sg.heart.use_pnt_x = -2.6830399 sg.heart.use_pnt_y = -4.1160302 sg.heart.use_pnt_z = 0 sg.heart.use_rot_x = 0 sg.heart.use_rot_y = 118.755 sg.heart.use_rot_z = 0 sg.heart.wav = "spHrtWeb.wav" sg.heart.touchable = FALSE sg.heart.can_put_away = FALSE sg.heart.lookAt = function(arg1) -- line 2282 arg1.seen = TRUE manny:say_line("/spma010/") end sg.heart.pickUp = function(arg1) -- line 2287 if manny:walk_closeto_object(arg1, 0.5) then START_CUT_SCENE() manny:wait_for_actor() arg1.visible_actor:set_collision_mode(COLLISION_OFF) manny:walkto_object(arg1) manny:wait_for_actor() manny:play_chore(ma_reach_low, "ma.cos") sleep_for(650) sg.heart:get() sg.heart:make_untouchable() manny:play_chore_looping(ma_activate_heart_beat, "ma.cos") start_sfx("sgGetHrt.wav") sleep_for(500) manny:play_chore_looping(ma_hold, "ma.cos") manny:stop_chore(ma_reach_low, "ma.cos") manny.is_holding = arg1 if not arg1.seen then arg1:lookAt() end END_CUT_SCENE() end end sg.heart.use = function(arg1) -- line 2311 if arg1.owner == manny then manny:say_line("/sgma058/") else arg1:pickUp() end end sg.heart.default_response = function(arg1) -- line 2319 manny:say_line("/sgma059/") end sg.heart.use_scythe = function(arg1) -- line 2323 manny:say_line("/sgma060/") end sg.heart.make_touchable = function(arg1) -- line 2327 if not arg1.visible_actor then arg1.visible_actor = Actor:create(nil, nil, nil, arg1.name) end Object.make_touchable(arg1) arg1.visible_actor:set_costume("sp_glottis_heart.cos") arg1.visible_actor:put_in_set(sg) arg1.visible_actor:setpos(arg1.obj_x, arg1.obj_y, arg1.obj_z) arg1.visible_actor:setrot(0, 0, 0) arg1.visible_actor:set_visibility(TRUE) arg1.visible_actor:play_chore_looping(0) arg1.visible_actor:set_collision_mode(COLLISION_BOX, 1.1) end sg.heart.make_untouchable = function(arg1) -- line 2342 if arg1.visible_actor then arg1.visible_actor:set_collision_mode(COLLISION_OFF) arg1.visible_actor:put_in_set(nil) arg1.visible_actor:set_visibility(FALSE) arg1.visible_actor:stop_chore(0) end Object.make_untouchable(arg1) end sg.heart.put_away = function(arg1) -- line 2352 arg1:default_response() return FALSE end sg.bone_wagon = Object:create(sg, "/sgtx061/Bone Wagon", 3.50579, -0.84495902, 0.2538, { range = 2.5 }) sg.bone_wagon.use_pnt_x = 1.63726 sg.bone_wagon.use_pnt_y = -0.094200999 sg.bone_wagon.use_pnt_z = 0 sg.bone_wagon.use_rot_x = 0 sg.bone_wagon.use_rot_y = 301.353 sg.bone_wagon.use_rot_z = 0 sg.bone_wagon.lookAt = function(arg1) -- line 2366 if not glottis.heartless then manny:say_line("/sgma062/") else manny:say_line("/sgma063/") end end sg.bone_wagon.pickUp = function(arg1) -- line 2374 system.default_response("tow") end sg.bone_wagon.use = function(arg1) -- line 2378 if not glottis.heartless then sg:get_in_BW() else manny:say_line("/trma068/") end end sg.bone_wagon.use_scythe = function(arg1) -- line 2386 manny:say_line("/sgma065/") end sg.bone_wagon.use_bone = function(arg1) -- line 2390 manny:say_line("/sgma066/") end sg.sm_door = Object:create(sg, "/sgtx067/trail", -5.7180099, -5.4510102, 1.1, { range = 1.5 }) sg.sg_sm_box = sg.sm_door sg.sg_sm_box_bw = sg.sm_door sg.sm_door.use_pnt_x = -4.5913901 sg.sm_door.use_pnt_y = -4.3188801 sg.sm_door.use_pnt_z = 0 sg.sm_door.use_rot_x = 0 sg.sm_door.use_rot_y = -224.203 sg.sm_door.use_rot_z = 0 sg.sm_door.out_pnt_x = -5.1719098 sg.sm_door.out_pnt_y = -4.9159999 sg.sm_door.out_pnt_z = 0 sg.sm_door.out_rot_x = 0 sg.sm_door.out_rot_y = -224.203 sg.sm_door.out_rot_z = 0 sg.sm_door.walkOut = function(arg1) -- line 2416 if manny.is_driving then bonewagon:squelch_sfx() if rnd(5) then glottis:say_line("/sggl071/") else glottis:say_line("/sggl069/") end glottis:wait_for_message() bonewagon:restore_sfx() elseif glottis.heartless then manny:say_line("/sgma070/") elseif not sg:check_post(arg1) then sm:come_out_door(sm.sg_door) end end sg.sm_door.comeOut = function(arg1) -- line 2435 if not glottis.ripped_heart then start_script(sg.glottis_rip_heart) else arg1:come_out_door() end end sg.sp_door = Object:create(sg, "/sgtx072/path", -2.20207, -6.4960999, 0.47999999, { range = 1.5 }) sg.sg_sp_box = sg.sp_door sg.sg_sp_box_bw = sg.sp_door sg.sp_door.use_pnt_x = -2.9080701 sg.sp_door.use_pnt_y = -6.0844102 sg.sp_door.use_pnt_z = 0 sg.sp_door.use_rot_x = 0 sg.sp_door.use_rot_y = 197.575 sg.sp_door.use_rot_z = 0 sg.sp_door.out_pnt_x = -2.1252999 sg.sp_door.out_pnt_y = -6.5885901 sg.sp_door.out_pnt_z = 0 sg.sp_door.out_rot_x = 0 sg.sp_door.out_rot_y = -152.37801 sg.sp_door.out_rot_z = 0 sg.sp_door.lookAt = function(arg1) -- line 2464 manny:say_line("/sgma073/") end sg.sp_door.walkOut = function(arg1) -- line 2468 if manny.is_driving then bonewagon:squelch_sfx() glottis:say_line("/sggl074/") glottis:wait_for_message() bonewagon:restore_sfx() elseif not sg:check_post(arg1) then if not sp.seen_intro then sp.intro_flag = TRUE end sp:come_out_door(sp.sg_door) end end sg.sp_door.comeOut = function(arg1) -- line 2484 system.lock_display() break_here() sg:current_setup(2) manny:setpos(-2.89254, -6.14322, 0) manny:setrot(0, 746.691, 0) system.unlock_display() end sg.mod_door = Object:create(sg, "/sgtx075/bumpy road", 12.542, 4.9489999, 0.80000001, { range = 1.5 }) sg.sg_mod_box = sg.mod_door sg.mod_door.use_pnt_x = 11.1404 sg.mod_door.use_pnt_y = 3.9449799 sg.mod_door.use_pnt_z = 0 sg.mod_door.use_rot_x = 0 sg.mod_door.use_rot_y = 320.28 sg.mod_door.use_rot_z = 0 sg.mod_door.out_pnt_x = 11.6844 sg.mod_door.out_pnt_y = 4.5656199 sg.mod_door.out_pnt_z = 0 sg.mod_door.out_rot_x = 0 sg.mod_door.out_rot_y = 301.72699 sg.mod_door.out_rot_z = 0 sg.mod_door.lookAt = function(arg1) -- line 2514 if glottis.talked_clearance then START_CUT_SCENE() manny:say_line("/sgma076/") manny:wait_for_message() manny:say_line("/sgma077/") END_CUT_SCENE() else manny:say_line("/sgma078/") end end sg.mod_door.walkOut = function(arg1) -- line 2526 local local1 if glottis.heartless then sg.sm_door:walkOut() elseif manny.is_driving then if mod_solved then START_CUT_SCENE() stop_script(bonewagon.gas) stop_script(bonewagon.reverse) stop_script(bonewagon.left) stop_script(bonewagon.right) bonewagon:brake(TRUE) bonewagon:stop_cruise_sounds() sleep_for(500) bonewagon:play_chore(bonewagon_gl_shocks) bonewagon:wait_for_chore(bonewagon_gl_shocks) bonewagon:play_chore_looping(bonewagon_gl_stay_Up) local1 = 0 bonewagon:set_walk_rate(1) bonewagon:ignore_boxes() while local1 < 1000 do bonewagon:walk_forward() break_here() local1 = local1 + system.frameTime end bonewagon:stop_chore(bonewagon_gl_stay_up) bonewagon:play_chore(bonewagon_gl_no_shocks) bonewagon:follow_boxes() END_CUT_SCENE() bv:drive_in() elseif not glottis.talked_clearance then glottis.talked_clearance = TRUE bonewagon:squelch_sfx() glottis:say_line("/sggl079/") glottis:wait_for_message() glottis:say_line("/sggl080/") glottis:wait_for_message() bonewagon:restore_sfx() else bonewagon:squelch_sfx() glottis:say_line("/sggl081/") glottis:wait_for_message() bonewagon:restore_sfx() end elseif not sg:check_post(arg1) then bv:come_out_door(bv.sg_door) end end sg.na_door = Object:create(sg, "/sgtx082/trail", -0.498, 7.7490001, 0.27000001, { range = 1.5 }) sg.sg_na_box = sg.na_door sg.na_door.use_pnt_x = -1.04241 sg.na_door.use_pnt_y = 6.2573299 sg.na_door.use_pnt_z = 0 sg.na_door.use_rot_x = 0 sg.na_door.use_rot_y = 332.31601 sg.na_door.use_rot_z = 0 sg.na_door.out_pnt_x = -0.35649699 sg.na_door.out_pnt_y = 7.70927 sg.na_door.out_pnt_z = 0 sg.na_door.out_rot_x = 0 sg.na_door.out_rot_y = -7.7764401 sg.na_door.out_rot_z = 0 sg.na_door.lookAt = function(arg1) -- line 2606 manny:say_line("/sgma083/") end sg.na_door.walkOut = function(arg1) -- line 2610 if glottis.heartless then sg.sm_door:walkOut() else na:come_out_door(na.sg_door) end end sg.tr_door = Object:create(sg, "/sgtx084/trail", 5.82793, -6.8160901, 0.5, { range = 1.5 }) sg.sg_tr_box = sg.tr_door sg.tr_door.use_pnt_x = 5.3253398 sg.tr_door.use_pnt_y = -5.6335101 sg.tr_door.use_pnt_z = 0 sg.tr_door.use_rot_x = 0 sg.tr_door.use_rot_y = -143.755 sg.tr_door.use_rot_z = 0 sg.tr_door.out_pnt_x = 6.01823 sg.tr_door.out_pnt_y = -6.7782698 sg.tr_door.out_pnt_z = 0 sg.tr_door.out_rot_x = 0 sg.tr_door.out_rot_y = -156.267 sg.tr_door.out_rot_z = 0 sg.tr_door.lookAt = function(arg1) -- line 2637 START_CUT_SCENE() ResetMarioControls() manny:say_line("/sgma085/") manny:setpos(5.43677, -5.04949, 0, 0, 11.5, 0) END_CUT_SCENE() end sg.tr_door.walkOut = function(arg1) -- line 2645 if glottis.heartless then sg.sm_door:walkOut() elseif not manny.is_driving then arg1:lookAt() else tr:drive_in() end end CheckFirstTime("rf.lua") dofile("pigeon_idles.lua") dofile("ma_crumble_bread.lua") rf = Set:create("rf.set", "Roof", { rf_nstoh = 0, rf_rufha = 1, rf_rufha2 = 1, rf_rufha3 = 1, rf_rufws = 2, rf_rufws2 = 2, rf_overhead = 3, rf_pigeon = 4 }) rf.camera_adjusts = { 320, 340, 25 } rf.cheat_boxes = { rf_cheat_box_1 = 1, rf_cheat_box_2 = 2 } rf.set_up_actors = function(arg1) -- line 34 if not ma_crumble_bread_cos then ma_crumble_bread_cos = "ma_crumble_bread.cos" end rf.escape_point_1:set_object_state("le_copals_windows.cos") rf.escape_point_2:set_object_state("le_open_doms_window.cos") rf.escape_point_1.interest_actor:play_chore(0) rf.escape_point_2.interest_actor:complete_chore(0) rf.escape_point_1.touchable = FALSE rf.escape_point_2.touchable = FALSE if rf.pigeons_gone then MakeSectorActive("bird_threshhold", TRUE) MakeSectorActive("rf_nstoh", TRUE) rf.pigeons1:stop_chore(0) rf.pigeons1:play_chore(1) rf.pigeons1:make_untouchable() rf.pigeons2:make_untouchable() rf.pigeons3:make_untouchable() else rf.init_pigeons() rf.pigeons1:set_object_state("pigeon_os.cos") rf.pigeons1:play_chore_looping(0) MakeSectorActive("bird_threshhold", FALSE) MakeSectorActive("rf_nstoh", FALSE) end if not rf.egg_actor then rf.egg_actor = Actor:create(nil, nil, nil, "egg_actor") rf.egg_actor1 = Actor:create(nil, nil, nil, "egg_actor") rf.egg_actor2 = Actor:create(nil, nil, nil, "egg_actor") rf.egg_actor3 = Actor:create(nil, nil, nil, "egg_actor") end if rf.eggs.owner ~= manny then rf.egg_actor:put_in_set(rf) rf.egg_actor:setpos(-13.43, 11.2, 4.28) rf.egg_actor:setrot(0, -334.498, 0) rf.egg_actor:set_costume("eggs.cos") end rf.egg_actor1:put_in_set(rf) rf.egg_actor1:setpos(-13.4255, 11.3217, 4.3) rf.egg_actor1:setrot(0, 210, 0) rf.egg_actor1:set_costume("eggs.cos") rf.egg_actor2:put_in_set(rf) rf.egg_actor2:setpos(-13.5055, 11.3117, 4.29) rf.egg_actor2:setrot(0, 90, 0) rf.egg_actor2:set_costume("eggs.cos") rf.egg_actor3:put_in_set(rf) rf.egg_actor3:setpos(-13.4602, 11.245, 4.31) rf.egg_actor3:setrot(0, -334.498, 0) rf.egg_actor3:set_costume("eggs.cos") end rf.balloon_placement = { } rf.balloon_placement.cat = { } rf.balloon_placement.dingo = { } rf.balloon_placement.frost = { } rf.balloon_placement["cat"].x = -11.3502 rf.balloon_placement["cat"].y = 7.77496 rf.balloon_placement["cat"].z = 3.8199999 rf.balloon_placement["cat"].cos = "cat_balloon.cos" rf.balloon_placement["cat"]["r"] = -54.182598 rf.balloon_placement["dingo"].x = -11.3502 rf.balloon_placement["dingo"].y = 7.77496 rf.balloon_placement["dingo"].z = 3.77 rf.balloon_placement["dingo"]["r"] = -57.493099 rf.balloon_placement["dingo"].cos = "dingo_balloon.cos" rf.balloon_placement["frost"].x = -11.3802 rf.balloon_placement["frost"].y = 7.7449598 rf.balloon_placement["frost"].z = 3.8199999 rf.balloon_placement["frost"]["r"] = -57.493099 rf.balloon_placement["frost"].cos = "frost_balloon.cos" rf.update_states = function(arg1) -- line 127 local local1 if not dish_item_actor then dish_item_actor = Actor:create(nil, nil, nil, "dish item") end if rf.dish.contains then if rf.dish.contains == fe.balloon_cat then local1 = "cat" elseif rf.dish.contains == fe.balloon_dingo then local1 = "dingo" elseif rf.dish.contains == fe.balloon_frost then local1 = "frost" end dish_item_actor:set_costume(rf.balloon_placement[local1].cos) dish_item_actor:put_in_set(rf) dish_item_actor:setpos(rf.balloon_placement[local1].x, rf.balloon_placement[local1].y, rf.balloon_placement[local1].z) dish_item_actor:setrot(0, rf.balloon_placement[local1].r, 0) dish_item_actor:scale(0.80000001) dish_item_actor:set_colormap("items_more.cmp") else dish_item_actor:free() end if rf.pigeons_gone then MakeSectorActive("bird_threshhold", TRUE) MakeSectorActive("rf_nstoh", TRUE) rf.pigeons1.touchable = FALSE rf.pigeons2.touchable = FALSE rf.pigeons3.touchable = FALSE rf.pigeons1:stop_chore(0) rf.pigeons1:play_chore(1) else rf.pigeons1.touchable = TRUE rf.pigeons2.touchable = TRUE rf.pigeons3.touchable = TRUE rf.pigeons1:play_chore_looping(0) end end rf.pigeon_liftoff = function(arg1) -- line 174 while 1 do arg1:offsetBy(0, 0, rnd(0.008, 0.03)) break_here() end end rf.pigeon_mover = function(arg1) -- line 181 local local1 = 0 local local2 = { } arg1.costume_marker_handler = nil arg1:play_chore_looping(pigeon_idles_fly_cycle) sleep_for(rnd(500, 1000)) repeat arg1:setpos(-1, 4.5, 4.54) local2 = arg1:getpos() PointActorAt(arg1.hActor, 4.1999998, rnd(3.5, 6), 4.54) arg1:play_sound_at("flockFly.wav") while local2.x <= 2 do arg1:walk_forward() break_here() local2 = arg1:getpos() end local1 = local1 + 1 until local1 == 3 end rf.pigeons_eat_bread = function() -- line 201 local local1 = 1 START_CUT_SCENE() cur_puzzle_state[9] = TRUE if rf.dish_contains then rf.dish_contains:free() end rf.pigeons_gone = TRUE rf.dish.contains = nil stop_script(rf.pigeon_brain) stop_script(rf.pigeon_attack) stop_script(rf.fly_fly_fly) stop_script(rf.pigeon_eat) stop_script(rf.turn_toward_home) stop_script(bird_climb) stop_script(rf.pigeon_walk) stop_sound("flockeat.imu") sleep_for(100) start_sfx("bloonpop.wav") prop_pigeon:stop_chore(nil) prop_pigeon:push_chore(pigeon_idles_scared_takeoff) prop_pigeon:push_chore() dish_item_actor:free() start_script(rf.pigeon_liftoff, prop_pigeon) repeat pigeons[local1]:stop_chore(nil) pigeons[local1]:play_chore(pigeon_idles_scared_takeoff) sleep_for(rnd(50, 150)) start_script(rf.pigeon_liftoff, pigeons[local1]) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS local1 = 1 sleep_for(1500) prop_pigeon:stop_chore(nil) prop_pigeon:put_in_set(nil) stop_script(rf.pigeon_liftoff) le:init_ropes() rf.pigeons1:stop_chore(0) rf.pigeons1:play_chore(1) rf:current_setup(rf_pigeon) local1 = 1 repeat pigeons[local1]:stop_chore(nil) pigeons[local1]:set_walk_rate(rnd(1, 2)) start_script(rf.pigeon_mover, pigeons[local1]) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS sleep_for(6000) rf:set_up_actors() rf:current_setup(rf_rufws) rf.pigeons1:stop_chore(0) rf.pigeons1:play_chore(1) stop_script(rf.pigeon_mover) local1 = 1 repeat pigeons[local1]:stop_chore(nil) pigeons[local1]:put_in_set(nil) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS break_here() rf.sky:make_touchable() manny:head_look_at(rf.sky) wait_for_message() music_state:set_sequence(seqLedgepeckers) sleep_for(3000) manny:say_line("/rfma054/") wait_for_message() rf.pigeons1:free_object_state() rf.sky:make_untouchable() manny:head_look_at(nil) END_CUT_SCENE() end rf.show_eggs = function(arg1) -- line 296 local local1 = 1 START_CUT_SCENE() set_override(rf.show_eggs_override, rf) rf:current_setup(rf_nstoh) local1 = 1 repeat pigeons[local1]:moveto(rnd(-13, -12.575), rnd(10.35, 11), 3.72) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS sleep_for(3000) rf:current_setup(rf_rufha) break_here() local1 = 1 repeat pigeons[local1]:setpos(-1 * rnd(12.575, 13.925), rnd(9.8249998, 11), 3.72) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS END_CUT_SCENE() end rf.show_eggs_override = function(arg1) -- line 321 local local1 = 1 repeat pigeons[local1]:setpos(-1 * rnd(12.575, 13.925), rnd(9.8249998, 11), 3.72) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS end rf.show_eggs_override = function(arg1, arg2) -- line 329 rf:current_setup(rf_rufha) local local1 = 1 repeat pigeons[local1]:set_chore_looping(pigeon_idles_pecking, FALSE) pigeons[local1]:set_chore_looping(pigeon_idles_jump_for_turn, FALSE) local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS if arg2 then kill_override() end end BZ_X = -13.25 BZ_7 = 10.45 BZ_Z = 3.72 rf.NUMBER_OF_PIGEONS = 7 FLY_SPEED = 0.80000001 PIGEON_GLIDE_SPEED = 0.5 PIGEON_WALK_SPEED = 0.1 pigeons = { } birdidle = { } birdidle[1] = pigeon_idles_pecking birdidle[2] = pigeon_idles_lead_to_walk birdidle[3] = pigeon_idles_jump_for_turn birdidle[4] = pigeon_idles_head_turns rf.all_pigeons_pecking = nil rf.kill_pigeons = nil rf.seen_birds = nil rf.no_attack_manny = FALSE rf.default_pigeon = function(arg1, arg2) -- line 383 arg1:set_costume("pigeon_idles.cos") arg1:set_colormap("pigeons.cmp") arg1:set_walk_rate(PIGEON_WALK_SPEED) arg1:set_turn_rate(90) arg1:ignore_boxes() end rf.pigeon_walk = function(arg1) -- line 398 arg1:play_chore(pigeon_idles_lead_to_walk) arg1:wait_for_chore() arg1:play_chore(pigeon_idles_walk_cycle) while arg1:is_choring() do arg1:walk_forward() break_here() end arg1:play_chore(pigeon_idles_stopwalk_cycle) while arg1:is_choring() do arg1:walk_forward() break_here() end if not arg1:find_sector_name("bird_zone") then repeat PointActorAt(arg1.hActor, arg1.start_pnt.x, arg1.start_pnt.y, arg1.start_pnt.z) arg1:play_chore(pigeon_idles_lead_to_walk) arg1:wait_for_chore() arg1:play_chore(pigeon_idles_walk_cycle) while arg1:is_choring() do arg1:walk_forward() break_here() end arg1:play_chore(pigeon_idles_stopwalk_cycle) while arg1:is_choring() do arg1:walk_forward() break_here() end until arg1:find_sector_name("bird_zone") end end rf.turn_toward_home = function(arg1) -- line 439 arg1:set_turn_rate(90) while TurnActorTo(arg1.hActor, arg1.start_pnt.x, arg1.start_pnt.y, arg1.start_pnt.z) do arg1:walk_forward() break_here() end while 1 do arg1:walk_forward() break_here() end end rf.fly_fly_fly = function(arg1) -- line 461 arg1:set_turn_rate(250) while 1 do while TurnActorTo(arg1.hActor, manny.hActor) do arg1:walk_forward() if proximity(arg1, manny) < 0.65 then if not find_script(rf.manny_flee) then start_script(rf.manny_flee) end end break_here() end arg1:walk_forward() break_here() end end rf.pigeon_attack = function(arg1) -- line 488 local local1 local local2 local local3 = { } if not inventory_disabled then inventory_disabled = TRUE end arg1:set_walk_rate(FLY_SPEED) local1 = start_script(rf.fly_fly_fly, arg1) foo2 = start_script(bird_climb, arg1, arg1.height, 1.6, pigeon_idles_scared_takeoff) wait_for_script(foo2) arg1:play_chore_looping(pigeon_idles_fly_cycle) while manny:find_sector_name("attack_zone") or manny:find_sector_name("attack_box") do break_here() end stop_sound("rfPigMus.imu") if inventory_disabled then inventory_disabled = FALSE end repeat local3 = arg1:getpos() local2 = sqrt((local3.x - arg1.start_pnt.x) ^ 2 + (local3.y - arg1.start_pnt.y) ^ 2 + (1 - 1) ^ 2) break_here() until local2 > 2 stop_script(local1) local1 = start_script(rf.turn_toward_home, arg1) arg1:set_chore_looping(pigeon_idles_fly_cycle, FALSE) arg1:wait_for_chore() SetActorWalkRate(arg1.hActor, PIGEON_GLIDE_SPEED) arg1:play_chore(pigeon_idles_glide_hook_up) arg1:wait_for_chore() arg1:play_chore_looping(pigeon_idles_glide) repeat local3 = arg1:getpos() local2 = sqrt((local3.x - arg1.start_pnt.x) ^ 2 + (local3.y - arg1.start_pnt.y) ^ 2 + (1 - 1) ^ 2) if local3.z > 3.95 then arg1:setpos(local3.x, local3.y, local3.z - 0.0040000002) end break_here() until local2 < 1 arg1:set_chore_looping(pigeon_idles_glide, FALSE) foo2 = start_script(bird_climb, arg1, arg1.start_pnt.z, 1, pigeon_idles_landing) wait_for_script(foo2) stop_script(local1) local3 = arg1:getpos() arg1:setpos(local3.x, local3.y, BZ_Z) arg1:set_walk_rate(PIGEON_WALK_SPEED) end rf.turn_to_food = function(arg1) -- line 558 arg1:set_turn_rate(250) while TurnActorTo(arg1.hActor, arg1.eat_pnt.x, arg1.eat_pnt.y, arg1.eat_pnt.z) do arg1:walk_forward() break_here() end while 1 do arg1:walk_forward() break_here() end end rf.pigeon_eat = function(arg1) -- line 577 local local1, local2 local local3 local local4 = { } local local5 local local6 local local7 = FALSE arg1.height = 4.0999999 arg1:set_walk_rate(FLY_SPEED) local1 = start_script(rf.turn_to_food, arg1) local2 = start_script(bird_climb, arg1, arg1.height, 1.6, pigeon_idles_scared_takeoff) wait_for_script(local2) arg1:play_chore_looping(pigeon_idles_fly_cycle) repeat local4 = arg1:getpos() local3 = sqrt((local4.x - arg1.eat_pnt.x) ^ 2 + (local4.y - arg1.eat_pnt.y) ^ 2) break_here() until local3 < 1.5 stop_script(local1) local4 = arg1:getpos() while local3 >= 0.050000001 do if not TurnActorTo(arg1.hActor, arg1.eat_pnt.x, arg1.eat_pnt.y, arg1.eat_pnt.z) then PointActorAt(arg1.hActor, arg1.eat_pnt.x, arg1.eat_pnt.y, arg1.eat_pnt.z) end local3 = sqrt((local4.x - arg1.eat_pnt.x) ^ 2 + (local4.y - arg1.eat_pnt.y) ^ 2) local5 = tan(15) * local3 local5 = local5 + arg1.eat_pnt.z local6 = GetActorWalkRate(arg1.hActor) if local6 >= local3 then if not local7 then local7 = TRUE arg1:stop_chore(pigeon_idles_fly_cycle) arg1:play_chore(pigeon_idles_landing) end end if PerSecond(local6) > local3 then arg1:set_walk_rate(local3) end arg1:walk_forward() local4 = arg1:getpos() arg1:setpos(local4.x, local4.y, local5) break_here() if local7 and not arg1:is_choring(pigeon_idles_landing) then arg1:setpos(arg1.eat_pnt.x, arg1.eat_pnt.y, arg1.eat_pnt.z) arg1:setrot(arg1.eat_rot.x, arg1.eat_rot.y, arg1.eat_rot.z) end end arg1:setpos(arg1.eat_pnt.x, arg1.eat_pnt.y, arg1.eat_pnt.z) arg1:setrot(arg1.eat_rot.x, arg1.eat_rot.y, arg1.eat_rot.z) arg1:wait_for_chore() arg1:play_chore_looping(pigeon_idles_pecking) arg1.eating = TRUE while not rf.all_pigeons_pecking do break_here() end arg1:set_chore_looping(pigeon_idles_pecking, FALSE) arg1:wait_for_chore() arg1.height = arg1.height + 0.0099999998 local1 = start_script(rf.pigeon_attack, arg1) wait_for_script(local1) arg1.eating = FALSE end rf.wait_for_pigeons = function() -- line 660 local local1 = 1 local local2 = 0 local local3 rf.all_pigeons_pecking = FALSE repeat if pigeons[local1].eating then if local1 == 1 then start_sfx("flockeat.imu") local3 = start_script(rf.diminish_bread_pile) end local1 = local1 + 1 else break_here() end local2 = local2 + 1 until local1 > rf.NUMBER_OF_PIGEONS or local2 > 500 if not local3 then local3 = start_script(rf.diminish_bread_pile) end wait_for_script(local3) rf.all_pigeons_pecking = TRUE rf.dish_contains = nil if rf.kill_pigeons then stop_script(rf.pigeon_brain) stop_script(rf.pigeon_eat) stop_script(rf.pigeon_attack) start_script(rf.pigeons_eat_bread) end end pigeon_coo_sfx = { "pigeon1.wav", "pigeon2.wav", "pigeon3.wav", "pigeon4.wav", "pigeon5.wav", "pigeon6.wav", "pigeon7.wav", "pigeon8.wav" } rf.pigeon_brain = function(arg1) -- line 703 local local1 local local2 local local3 arg1.start_pnt = arg1:getpos() break_here() while TRUE do if manny:find_sector_name("attack_zone") or manny:find_sector_name("attack_box") and not rf.no_attack_manny then single_start_sfx("rfPigMus.imu") arg1.height = arg1.start_pnt.z + rnd(0.51999998, 0.62) local2 = start_script(rf.pigeon_attack, arg1) wait_for_script(local2) arg1:play_chore(pigeon_idles_standing) elseif find_script(rf.wait_for_pigeons) then local2 = start_script(rf.pigeon_eat, arg1) wait_for_script(local2) rf:update_states() else local1 = pick_from_nonweighted_table(birdidle) if local1 == pigeon_idles_lead_to_walk then local2 = start_script(rf.pigeon_walk, arg1) wait_for_script(local2) elseif local1 == pigeon_idles_jump_for_turn then if rnd() then arg1:turn_right(90) else arg1:turn_left(90) end end if rnd() then local3 = pick_one_of(pigeon_coo_sfx, TRUE) if rnd() then single_start_sfx(local3) end end arg1:play_chore(local1) arg1:wait_for_chore() end end end rf.init_pigeons = function() -- line 764 local local1 = 0 local local2 repeat local1 = local1 + 1 if not pigeons[local1] then pigeons[local1] = Actor:create(nil, nil, nil, "pigeon" .. local1) end pigeons[local1].costume_marker_handler = bird_sound_monitor pigeons[local1].eat_pnt = { } pigeons[local1].eat_rot = { } pigeons[local1].start_pnt = { } if local1 == 1 then pigeons[local1].eat_pnt.x = -11.4224 pigeons[local1].eat_pnt.y = 7.7199998 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -123.455 pigeons[local1].eat_rot.z = 0 elseif local1 == 2 then pigeons[local1].eat_pnt.x = -11.4524 pigeons[local1].eat_pnt.y = 7.8200002 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -89.845901 pigeons[local1].eat_rot.z = 0 elseif local1 == 3 then pigeons[local1].eat_pnt.x = -11.4324 pigeons[local1].eat_pnt.y = 7.77 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -56.6021 pigeons[local1].eat_rot.z = 0 elseif local1 == 4 then pigeons[local1].eat_pnt.x = -11.3824 pigeons[local1].eat_pnt.y = 7.9099998 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -89.845901 pigeons[local1].eat_rot.z = 0 elseif local1 == 5 then pigeons[local1].eat_pnt.x = -11.3024 pigeons[local1].eat_pnt.y = 7.9000001 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -123.455 pigeons[local1].eat_rot.z = 0 elseif local1 == 6 then pigeons[local1].eat_pnt.x = -11.3024 pigeons[local1].eat_pnt.y = 7.9000001 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -123.455 pigeons[local1].eat_rot.z = 0 elseif local1 == 7 then pigeons[local1].eat_pnt.x = -11.3024 pigeons[local1].eat_pnt.y = 7.9000001 pigeons[local1].eat_pnt.z = 3.8 pigeons[local1].eat_rot.x = 0 pigeons[local1].eat_rot.y = -123.455 pigeons[local1].eat_rot.z = 0 end rf.default_pigeon(pigeons[local1], local1) pigeons[local1].start_pnt.x = nil pigeons[local1].start_pnt.y = nil pigeons[local1].start_pnt.z = nil pigeons[local1].height = nil pigeons[local1].eating = nil pigeons[local1]:put_in_set(rf) pigeons[local1]:setpos(-1 * rnd(12.575, 13.925), rnd(9.8249998, 11), BZ_Z) start_script(rf.pigeon_brain, pigeons[local1]) until local1 == rf.NUMBER_OF_PIGEONS if not prop_pigeon then prop_pigeon = Actor:create(nil, nil, nil, "prop pigeon") end rf.default_pigeon(prop_pigeon, 6) prop_pigeon:put_in_set(rf) prop_pigeon:setpos(-13.4947, 11.19, 4.6799998) prop_pigeon:setrot(0, -179.218, 0) prop_pigeon:play_chore_looping(pigeon_idles_pecking) end rf.manny_flee = function() -- line 859 local local1, local2 stop_script(monitor_run) START_CUT_SCENE() manny:set_walk_backwards(FALSE) manny:set_turn_rate(360) rf.pigeons1.count = rf.pigeons1.count + 1 if rf.pigeons1.count == 1 then manny:say_line("/rfma044/") elseif rf.pigeons1.count == 2 then manny:say_line("/rfma045/") elseif rf.pigeons1.count == 3 then manny:say_line("/rfma046/") elseif rf.pigeons1.count == 4 then manny:say_line("/rfma047/") elseif rf.pigeons1.count == 5 then manny:say_line("/rfma048/") elseif rf.pigeons1.count == 6 then manny:say_line("/rfma049/") else manny:say_line("/rfma050/") end local1 = object_proximity(rf.escape_point_1) local2 = object_proximity(rf.escape_point_2) if local1 <= local2 then local2 = object_proximity(rf.escape_point_3) if local1 <= local2 then manny:runto(rf.escape_point_1.use_pnt_x, rf.escape_point_1.use_pnt_y, rf.escape_point_1.use_pnt_z) else manny:runto(rf.escape_point_3.use_pnt_x, rf.escape_point_3.use_pnt_y, rf.escape_point_3.use_pnt_z) end else local2 = object_proximity(rf.escape_point_4) if local1 <= local2 then manny:runto(rf.escape_point_2.use_pnt_x, rf.escape_point_2.use_pnt_y, rf.escape_point_2.use_pnt_z) else manny:runto(rf.escape_point_4.use_pnt_x, rf.escape_point_4.use_pnt_y, rf.escape_point_4.use_pnt_z) end end fade_sfx("rfPigMus.imu") manny:wait_for_actor() manny:set_run(FALSE) manny:wait_for_message() break_here() manny:turn_toward_entity(rf.pigeons1) END_CUT_SCENE() if inventory_disabled then inventory_disabled = FALSE end end rf.manny_follow_birds = function() -- line 916 while 1 do manny:head_look_at(pigeons[1]) break_here() end end rf.grow_bread_pile = function() -- line 929 local local1 = 0.1 local local2 = { } if not bread_pile_actor then bread_pile_actor = Actor:create(nil, nil, nil, "bread pile actor") end bread_pile_actor:put_in_set(rf) bread_pile_actor:set_costume("bread_pile.cos") bread_pile_actor:setpos(-11.3908, 7.7994599, 3.76) bread_pile_actor:setrot(0, 0, 0) bread_pile_actor:scale(local1) repeat local2 = bread_pile_actor:getpos() local1 = local1 + PerSecond(0.21250001) local2.z = local2.z + PerSecond(0.003) bread_pile_actor:scale(local1) bread_pile_actor:setpos(local2.x, local2.y, local2.z) break_here() until local1 >= 1.7 end rf.diminish_bread_pile = function() -- line 954 local local1 = 1.7 local local2 = { } repeat local2 = bread_pile_actor:getpos() local1 = local1 - PerSecond(0.42500001) local2.z = local2.z - PerSecond(0.0060000001) SetActorScale(bread_pile_actor.hActor, local1) bread_pile_actor:setpos(local2.x, local2.y, local2.z) break_here() until local1 <= 0.1 stop_sound("flockeat.imu") bread_pile_actor:free() end rf.enter = function(arg1) -- line 978 LoadCostume("ma_crumble_bread.cos") NewObjectState(rf_rufws, OBJSTATE_UNDERLAY, "flock_ws_comp.bm", nil, TRUE) NewObjectState(rf_rufws, OBJSTATE_UNDERLAY, "flock_ws1_comp.bm", nil, TRUE) NewObjectState(rf_rufha, OBJSTATE_UNDERLAY, "flock_ha_comp.bm", nil, TRUE) NewObjectState(rf_pigeon, OBJSTATE_OVERLAY, "le_cl_.bm") manny.footsteps = footsteps.gravel manny:put_in_set(rf) rf:set_up_actors() rf:update_states() rf:camerachange() SetShadowColor(15, 15, 15) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 0, 1000, 1000) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") end rf.exit = function(arg1) -- line 1002 local local1 = 1 stop_script(rf.pigeon_brain) stop_script(rf.pigeon_attack) stop_script(rf.fly_fly_fly) stop_script(rf.pigeon_eat) stop_script(rf.turn_toward_home) stop_script(bird_climb) stop_script(rf.pigeon_walk) prop_pigeon:free() repeat pigeons[local1]:free() local1 = local1 + 1 until local1 > rf.NUMBER_OF_PIGEONS KillActorShadows(manny.hActor) rf.pigeons1:free_object_state() rf.pigeons2:free_object_state() rf.pigeons3:free_object_state() dish_item_actor:free() rf.egg_actor:free() rf.egg_actor1:free() rf.egg_actor2:free() rf.egg_actor3:free() rf.escape_point_1:free_object_state() rf.escape_point_2:free_object_state() end rf.ladder_object = Object:create(rf, "/rftx002/ladder", -4.2644401, 3.6105299, 4.6999998, { range = 0 }) rf.rf_ladder_box = rf.ladder_object rf.ladder_object.use_pnt_x = -2.306 rf.ladder_object.use_pnt_y = 4.7729998 rf.ladder_object.use_pnt_z = 3.72 rf.ladder_object.use_rot_x = 0 rf.ladder_object.use_rot_y = -545.13 rf.ladder_object.use_rot_z = 0 rf.ladder_object.out_pnt_x = -2.3640001 rf.ladder_object.out_pnt_y = 4.138 rf.ladder_object.out_pnt_z = 3.72 rf.ladder_object.out_rot_x = 0 rf.ladder_object.out_rot_y = -545.13 rf.ladder_object.out_rot_z = 0 rf.ladder_object.walkOut = function(arg1) -- line 1061 manny:clear_hands() le:switch_to_set() manny:put_in_set(le) le:current_setup(le_alloh) manny:follow_boxes() manny:setpos(le.rope_up.use_pnt_x, le.rope_up.use_pnt_y, le.rope_up.use_pnt_z) manny:setrot(le.rope_up.use_rot_x, le.rope_up.use_rot_y, le.rope_up.use_rot_z) end rf.dish = Object:create(rf, "", -11.5502, 7.79496, 3.72, { range = 1 }) rf.dish.use_pnt_x = -11.55 rf.dish.use_pnt_y = 7.7964301 rf.dish.use_pnt_z = 3.72 rf.dish.use_rot_x = 0 rf.dish.use_rot_y = -88.131897 rf.dish.use_rot_z = 0 rf.dish.contains = nil rf.dish.walk_to_me = function(arg1) -- line 1084 local local1 local local2 = 9999 START_CUT_SCENE() repeat TurnActorTo(manny.hActor, -11.36, 7.7849598, 3.72) local1 = local2 manny:walk_forward() break_here() local2 = point_proximity(-11.325, 7.8000002, 3.72) until local2 >= local1 while TurnActorTo(manny.hActor, -11.36, 7.7849598, 3.72) do break_here() end END_CUT_SCENE() end rf.dish.lookAt = function(arg1) -- line 1101 if arg1.contains == nil then if rf.pigeons_gone then manny:say_line("/rfma004/") else manny:say_line("/rfma005/") end elseif arg1.contains == fe.balloon_cat or arg1.contains == fe.balloon_dingo or arg1.contains == fe.balloon_frost then manny:say_line("/rfma006/") else manny:say_line("/rfma007/") end end rf.dish.pickUp = function(arg1) -- line 1116 local local1 = arg1.contains local local2 if arg1.contains then START_CUT_SCENE() arg1:walk_to_me() if local1 == fe.balloon_cat then local2 = ms_activate_cat_balloon elseif local1 == fe.balloon_dingo then local2 = ms_activate_dingo_balloon elseif local1 == fe.balloon_frost then local2 = ms_activate_frost_balloon end manny:play_chore(ms_reach_med, "ms.cos") sleep_for(603) arg1.contains:get() arg1.contains = nil rf:update_states() manny:play_chore_looping(local2, "ms.cos") manny:play_chore_looping(ms_hold, "ms.cos") manny.is_holding = local1 manny.hold_chore = local2 manny:wait_for_chore(ms_reach_med, "ms.cos") manny:stop_chore(ms_reach_med, "ms.cos") END_CUT_SCENE() else manny:say_line("/rfma008/") end end rf.dish.use = function(arg1) -- line 1147 arg1:walk_to_me() if arg1.contains then arg1:pickUp() else manny:say_line("/rfma009/") end end rf.dish.use_eggs = function(arg1) -- line 1157 arg1:walk_to_me() manny:say_line("/rfma010/") end rf.dish.add_item = function(arg1, arg2) -- line 1162 local local1 = arg1.contains local local2 rf.no_attack_manny = TRUE arg1:walk_to_me() if not rf.pigeons_gone then if arg2 == fe.breads.bread1 or arg2 == fe.breads.bread2 or arg2 == fe.breads.bread3 or arg2 == fe.breads.bread4 or arg2 == fe.breads.bread5 then arg2:free() arg2.owner = fe.basket START_CUT_SCENE("no head") manny:stop_chore(ms_hold_bread, "ms.cos") manny:push_costume(ma_crumble_bread_cos) manny:play_chore(ma_crumble_bread_crumble_bread, ma_crumble_bread_cos) manny:play_sound_at("breadbrk.wav") manny:play_sound_at("breadpor.wav") start_script(rf.grow_bread_pile) manny:wait_for_chore(ma_crumble_bread_crumble_bread, ma_crumble_bread_cos) manny:pop_costume() manny.move_in_reverse = TRUE start_script(move_actor_backward, system.currentActor.hActor) sleep_for(1000) stop_script(move_actor_backward) system.currentActor:set_walk_backwards(FALSE) manny.move_in_reverse = FALSE manny:walkto(-11.9406, 7.3115101, 3.72) manny:wait_for_actor() manny:turn_toward_entity(rf.dish) start_script(rf.manny_follow_birds) if rf.dish.contains then rf.kill_pigeons = TRUE end rf.dish.foo = start_script(rf.wait_for_pigeons) wait_for_script(rf.dish.foo) wait_for_script(rf.pigeon_eat) stop_script(rf.manny_follow_birds) END_CUT_SCENE() else START_CUT_SCENE() if arg1.contains then if local1 == fe.balloon_cat then local2 = ms_activate_cat_balloon elseif local1 == fe.balloon_dingo then local2 = ms_activate_dingo_balloon elseif local1 == fe.balloon_frost then local2 = ms_activate_frost_balloon end manny:stop_chore(ms_hold, "ms.cos") manny:play_chore(ms_reach_med, "ms.cos") sleep_for(603) arg2:free() arg1.contains:get() arg1.contains = arg2 arg2.owner = rf.dish rf:update_states() manny:stop_chore(manny.hold_chore, "ms.cos") manny:play_chore_looping(local2, "ms.cos") manny:play_chore_looping(ms_hold, "ms.cos") manny.is_holding = local1 manny.hold_chore = local2 manny:wait_for_chore(ms_reach_med, "ms.cos") else manny:stop_chore(ms_hold, "ms.cos") manny:play_chore(ms_reach_med, "ms.cos") sleep_for(603) arg2:free() arg1.contains = arg2 arg2.owner = rf.dish rf:update_states() manny:stop_chore(manny.hold_chore, "ms.cos") manny.hold_chore = nil manny.is_holding = nil manny:wait_for_chore(ms_reach_med, "ms.cos") end END_CUT_SCENE() if not rf.tried_scary_balloon then rf.tried_scary_balloon = TRUE manny:say_line("/rfma011/") end end rf.no_attack_manny = FALSE elseif arg2 == fe.breads.bread1 or arg2 == fe.breads.bread2 or arg2 == fe.breads.bread3 or arg2 == fe.breads.bread4 or arg2 == fe.breads.bread5 then arg2:default_response() else arg2:use() end end rf.dish.use_cat_balloon = function(arg1, arg2) -- line 1260 arg1:add_item(arg2) end rf.dish.use_dingo_balloon = function(arg1, arg2) -- line 1264 arg1:add_item(arg2) end rf.dish.use_frost_balloon = function(arg1, arg2) -- line 1268 arg1:add_item(arg2) end rf.dish.use_bread = function(arg1, arg2) -- line 1272 arg1:add_item(arg2) end rf.eggs = Object:create(rf, "/rftx012/eggs", 0, 0, 0, { range = 0 }) rf.eggs.lookAt = function(arg1) -- line 1281 manny:say_line("/rfma013/") end rf.eggs.use = function(arg1) -- line 1285 manny:say_line("/rfma014/") end rf.eggs.default_response = function(arg1) -- line 1289 manny:say_line("/rfma015/") end rf.nest = Object:create(rf, "/rftx016/nest", -13.4724, 11.2718, 4.27, { range = 0.69999999 }) rf.nest.use_pnt_x = -13.4422 rf.nest.use_pnt_y = 11.0513 rf.nest.use_pnt_z = 3.72 rf.nest.use_rot_x = 0 rf.nest.use_rot_y = 12.124 rf.nest.use_rot_z = 0 rf.nest.contains = rf.eggs rf.nest.use_eggs = function(arg1) -- line 1305 manny:say_line("/rfma010/") end rf.nest.lookAt = function(arg1) -- line 1309 if arg1.contains == rf.eggs then manny:say_line("/rfma017/") else manny:say_line("/rfma018/") end end rf.nest.pickUp = function(arg1) -- line 1317 if arg1.contains == rf.eggs then START_CUT_SCENE() manny:walkto_object(arg1) manny:say_line("/rfma019/") manny:play_chore(ms_reach_high, "ms.cos") sleep_for(1407) start_sfx("getEggs.wav") rf.egg_actor:free() arg1.contains = nil rf.eggs:get() rf.eggs.wav = "getEggs.wav" manny:play_chore_looping(ms_activate_eggs, "ms.cos") sleep_for(704) manny:play_chore_looping(ms_hold, "ms.cos") manny.hold_chore = ms_activate_eggs manny.is_holding = rf.eggs manny:wait_for_chore(ms_reach_high, "ms.cos") manny:stop_chore(ms_reach_high, "ms.cos") manny:head_look_at(nil) END_CUT_SCENE() else arg1:lookAt() end end rf.nest.use = rf.nest.pickUp rf.pigeons1 = Object:create(rf, "/rftx021/pigeons", -13.3372, 10.6634, 3.72, { range = 3.5999999 }) rf.pigeons1.use_pnt_x = -10.4459 rf.pigeons1.use_pnt_y = 8.5341501 rf.pigeons1.use_pnt_z = 3.72 rf.pigeons1.use_rot_x = 0 rf.pigeons1.use_rot_y = -320.36401 rf.pigeons1.use_rot_z = 0 rf.pigeons1.look_count = 0 rf.pigeons1.count = 0 rf.pigeons1.lookAt = function(arg1) -- line 1362 rf.pigeons1.look_count = rf.pigeons1.look_count + 1 if rf.pigeons1.look_count == 1 then manny:say_line("/rfma022/") elseif rf.pigeons1.look_count == 2 then manny:say_line("/rfma023/") elseif rf.pigeons1.look_count == 3 then manny:say_line("/rfma024/") elseif rf.pigeons1.look_count == 4 then manny:say_line("/rfma025/") elseif rf.pigeons1.look_count == 5 then manny:say_line("/rfma026/") else arg1:use() end end rf.pigeons1.pickUp = function(arg1) -- line 1380 manny:say_line("/rfma027/") if salvador.talked_pigeons then START_CUT_SCENE() wait_for_message() manny:say_line("/rfma028/") END_CUT_SCENE() end end rf.pigeons1.use = function(arg1) -- line 1391 manny:say_line("/rfma029/") end rf.pigeons1.not_working = function(arg1) -- line 1395 manny:say_line("/rfma030/") wait_for_message() end rf.pigeons1.use_cat_balloon = function(arg1) -- line 1400 START_CUT_SCENE() fe.balloon_cat:use() wait_for_message() rf.pigeons1:not_working() manny:say_line("/rfma031/") END_CUT_SCENE() end rf.pigeons1.use_dingo_balloon = function(arg1) -- line 1409 START_CUT_SCENE() fe.balloon_dingo:use() wait_for_message() manny:say_line("/rfma032/") END_CUT_SCENE() end rf.pigeons1.use_frost_balloon = function(arg1) -- line 1416 START_CUT_SCENE() fe.balloon_frost:use() wait_for_message() manny:say_line("/rfma033/") END_CUT_SCENE() end rf.pigeons1.use_scythe = function(arg1) -- line 1437 START_CUT_SCENE() manny:say_line("/rfma037/") wait_for_message() mo.scythe:use() sleep_for(500) manny:say_line("/rfma038/") END_CUT_SCENE() end rf.pigeons1.use_mouthpiece = function(arg1) -- line 1447 manny:say_line("/rfma039/") wait_for_message() manny:say_line("/rfma040/") wait_for_message() manny:say_line("/rfma041/") end rf.pigeons1.use_bread = function(arg1) -- line 1455 manny:say_line("/rfma042/") end rf.pigeons2 = Object:create(rf, "/rftx051/pigeons", -13.3372, 10.6634, 3.72, { range = 0 }) rf.pigeons2.use_pnt_x = -10.4459 rf.pigeons2.use_pnt_y = 8.5341501 rf.pigeons2.use_pnt_z = 3.72 rf.pigeons2.use_rot_x = 0 rf.pigeons2.use_rot_y = -320.36401 rf.pigeons2.use_rot_z = 0 rf.pigeons2.parent = rf.pigeons1 rf.pigeons3 = Object:create(rf, "/rftx051/pigeons", -13.3372, 10.6634, 3.72, { range = 0 }) rf.pigeons3.use_pnt_x = -10.4459 rf.pigeons3.use_pnt_y = 8.5341501 rf.pigeons3.use_pnt_z = 3.72 rf.pigeons3.use_rot_x = 0 rf.pigeons3.use_rot_y = -320.36401 rf.pigeons3.use_rot_z = 0 rf.pigeons3.parent = rf.pigeons1 rf.sky = Object:create(rf, "/rftx053/sky", -12.9724, 9.50179, 5.5999999, { range = 0.5 }) rf.sky.use_pnt_x = -10.83 rf.sky.use_pnt_y = 7.934 rf.sky.use_pnt_z = 3.72 rf.sky.use_rot_x = 0 rf.sky.use_rot_y = -303.345 rf.sky.use_rot_z = 0 rf.sky:make_untouchable() rf.sky.lookAt = function(arg1) -- line 1493 end rf.sky.pickUp = function(arg1) -- line 1496 end rf.sky.use = function(arg1) -- line 1499 end rf.escape_point_1 = Object:create(rf, "/rftx055/x", -10.1976, 9.35886, 3.72, { range = 0 }) rf.escape_point_1.use_pnt_x = -10.1976 rf.escape_point_1.use_pnt_y = 9.35886 rf.escape_point_1.use_pnt_z = 3.72 rf.escape_point_1.use_rot_x = 0 rf.escape_point_1.use_rot_y = -78.999199 rf.escape_point_1.use_rot_z = 0 rf.escape_point_2 = Object:create(rf, "/rftx056/x", -12.7606, 6.9607301, 3.72, { range = 0 }) rf.escape_point_2.use_pnt_x = -12.7606 rf.escape_point_2.use_pnt_y = 6.9607301 rf.escape_point_2.use_pnt_z = 3.72 rf.escape_point_2.use_rot_x = 0 rf.escape_point_2.use_rot_y = 200.63 rf.escape_point_2.use_rot_z = 0 rf.escape_point_3 = Object:create(rf, "", -10.5521, 7.8463898, 3.72, { range = 0 }) rf.escape_point_3.use_pnt_x = -10.5521 rf.escape_point_3.use_pnt_y = 7.8463898 rf.escape_point_3.use_pnt_z = 3.72 rf.escape_point_3.use_rot_x = 0 rf.escape_point_3.use_rot_y = -41.502998 rf.escape_point_3.use_rot_z = 0 rf.escape_point_3:make_untouchable() rf.escape_point_4 = Object:create(rf, "", -11.4381, 6.9501801, 3.72, { range = 0 }) rf.escape_point_4.use_pnt_x = -11.4381 rf.escape_point_4.use_pnt_y = 6.9501801 rf.escape_point_4.use_pnt_z = 3.72 rf.escape_point_4.use_rot_x = 0 rf.escape_point_4.use_rot_y = -469.336 rf.escape_point_4.use_rot_z = 0 rf.escape_point_4:make_untouchable() CheckFirstTime("na.lua") dofile("na_trapdoor.lua") na = Set:create("na.set", "navigation room", { na_top = 0, na_intha = 1, na_intws = 2, na_mancu = 3 }) na.bw_out_points = { } na.bw_out_points[0] = { pos = { x = 3.15329, y = -0.641857, z = 0.5 }, rot = { x = 0, y = 18.6574, z = 0 } } na.bw_out_points[1] = { pos = { x = -0.222127, y = 3.55086, z = 0.5 }, rot = { x = 0, y = 227.602, z = 0 } } na.bw_out_points[2] = { pos = { x = -2.89712, y = 3.16993, z = 0.5 }, rot = { x = 0, y = 339.683, z = 0 } } na.bw_out_points[3] = { pos = { x = 5.22106, y = -1.634, z = 0.5 }, rot = { x = 0, y = 188.897, z = 0 } } na.bw_out_points[4] = { pos = { x = 0.770985, y = -3.77095, z = 0.5 }, rot = { x = 0, y = 92.7718, z = 0 } } na.bw_out_points[5] = { pos = { x = 3.32583, y = -1.69583, z = 0.5 }, rot = { x = 0, y = 137.086, z = 0 } } na.SIGNPOST_SOLVED_DISTANCE = 0.6 na.check_for_nav_solved = function(arg1, arg2) -- line 26 local local1 local local2, local3, local4, local5 local local6 if not arg2 then local1 = proximity(signpost.hActor, na.rubacava_point.x, na.rubacava_point.y, na.rubacava_point.z) else local1 = sqrt((arg2.x - na.rubacava_point.x) ^ 2 + (arg2.y - na.rubacava_point.y) ^ 2 + (arg2.z - na.rubacava_point.z) ^ 2) end if local1 <= na.SIGNPOST_SOLVED_DISTANCE then START_CUT_SCENE() set_override(na.skip_check_nav_solved, na) start_sfx("quake.IMU") set_pan("quake.IMU", 20) sleep_for(500) local2 = manny:getpos() local3 = manny:get_positive_rot() local4 = { x = -1, y = 0.5, z = 0 } local4 = RotateVector(local4, local3) local4.x = local4.x + local2.x local4.y = local4.y + local2.y local4.z = local2.z + 0.30000001 manny:head_look_at_point(local4.x, local4.y, local4.z) sleep_for(2000) local5 = start_sfx("quake.IMU") set_pan(local5, 100) local4 = { x = 1, y = 0.5, z = 0 } local4 = RotateVector(local4, local3) local4.x = local4.x + local2.x local4.y = local4.y + local2.y local4.z = local2.z + 0.30000001 manny:head_look_at_point(local4.x, local4.y, local4.z) sleep_for(2000) local4 = { x = 0, y = -3, z = 0 } local4 = RotateVector(local4, local3) local4.x = local4.x + local2.x local4.y = local4.y + local2.y local4.z = local2.z manny:setrot(local3.x, local3.y + 180, local3.z, TRUE) manny:runto(local4.x, local4.y, local4.z) local6 = 0 while local6 < 2000 and manny:is_moving() do break_here() local6 = local6 + system.frameTime end fade_sfx(local5, 3000, 0) fade_sfx("quake.IMU", 3000, 0) na:current_setup(na_intha) RunFullscreenMovie("dooropen.snm") END_CUT_SCENE() manny:set_run(FALSE) na:solve_nav() return TRUE else return FALSE end end na.skip_check_nav_solved = function(arg1) -- line 93 kill_override() manny:set_run(FALSE) stop_sound("quake.IMU") na:current_setup(na_intha) manny:head_look_at(nil) na:solve_nav() end na.solve_nav = function(arg1) -- line 102 cur_puzzle_state[13] = TRUE na.trapdoor:make_touchable() signpost.current_set = nil signpost:free() sg.signpost:make_untouchable() na.signpost:make_untouchable() na.trapdoor:play_chore(na_trapdoor_show, "na_trapdoor.cos") bonewagon:set_visibility(TRUE) bonewagon:set_collision_mode(COLLISION_BOX, 1) if bonewagon.current_set == na then bonewagon:setpos(3.60411, -0.419015, 0.5) bonewagon:setrot(0, 159.729, 0) bonewagon.current_pos = { x = 3.60411, y = -0.419015, z = 0.5 } bonewagon.current_rot = { x = 0, y = 159.729, z = 0 } sg:park_BW_obj() end na:activate_trapdoor_boxes(TRUE) na.trapdoor:play_chore(na_trapdoor_show, "na_trapdoor.cos") manny:put_at_object(na.trapdoor) nav_solved = TRUE music_state:set_state(stateNA_SOLVED) START_CUT_SCENE() manny:say_line("/sgma053/") manny:wait_for_message() END_CUT_SCENE() end na.activate_trapdoor_boxes = function(arg1, arg2) -- line 136 local local1, local2 MakeSectorActive("na_lb_box", arg2) local2 = 1 while local2 <= 11 do local1 = "trap_box" .. local2 MakeSectorActive(local1, arg2) local2 = local2 + 1 end MakeSectorActive("notrap_box", not arg2) single_start_script(na.footstep_monitor, na) end na.rubacava_point = nil na.choose_random_sign_point = function(arg1) -- line 154 local local1 if arg1.rubacava_point == nil then local1 = { } local1.x = -1.2223099 local1.y = -0.205108 local1.z = 0.5 arg1.rubacava_point = local1 end end na.tilt_bonewagon = function(arg1) -- line 172 local local1 while not bonewagon:find_sector_name("trap_box9") do break_here() end while bonewagon:find_sector_name("trap_box9") do local1 = proximity(bonewagon.hActor, -0.161172, -1.64503, 0.5) * -30 if local1 > 0 then local1 = 0 elseif local1 < -30 then local1 = -30 end SetActorPitch(bonewagon.hActor, local1) break_here() end end na.footstep_monitor = function(arg1) -- line 190 while TRUE do if manny:find_sector_name("trap_box9") or manny:find_sector_name("trap_box11") then manny.footsteps = footsteps.metal else manny.footsteps = footsteps.dirt end break_here() end end na.examine_signpost = function(arg1) -- line 201 local local1, local2 local local3, local4, local5 local local6 START_CUT_SCENE() local1 = { } local1.pos = signpost:getpos() local1.rot = signpost:getrot() local2 = { } local2.pos = manny:getpos() local2.rot = manny:getrot() local6 = na:current_setup() na:current_setup(na_mancu) signpost:setpos(4.0353198, -1.21448, 0.5) local3 = 3.8364899 + (local2.pos.x - local1.pos.x) local4 = -1.23856 + (local2.pos.y - local1.pos.y) local5 = 0.5 manny:ignore_boxes() manny:setpos(local3, local4, local5) if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(FALSE) bonewagon:set_collision_mode(COLLISION_OFF) end manny:head_look_at_point({ 4.0353198, -1.21448, 1 }) if not na.nav_points.happened then manny:say_line("/nama003/") else manny:say_line("/nama004/") end manny:wait_for_message() sleep_for(1000) na:current_setup(local6) signpost:setpos(local1.pos.x, local1.pos.y, local1.pos.z) manny:follow_boxes() manny:setpos(local2.pos.x, local2.pos.y, local2.pos.z) manny:head_look_at(na.signpost) if bonewagon.current_set == system.currentSet then bonewagon:set_visibility(TRUE) bonewagon:set_collision_mode(COLLISION_BOX, 1) end END_CUT_SCENE() end na.enter = function(arg1) -- line 255 manny:set_collision_mode(COLLISION_SPHERE, 0.4) na:choose_random_sign_point() na:add_object_state(na_intha, "na_trapdoor.bm", "na_trapdoor.zbm", OBJSTATE_STATE) na.trapdoor:set_object_state("na_trapdoor.cos") if nav_solved then na:activate_trapdoor_boxes(TRUE) na.trapdoor:play_chore(na_trapdoor_show, "na_trapdoor.cos") start_script(na.tilt_bonewagon, na) else na:activate_trapdoor_boxes(FALSE) na.trapdoor:play_chore(na_trapdoor_hide, "na_trapdoor.cos") end if bonewagon.current_set == arg1 then bonewagon:put_in_set(arg1) bonewagon:setpos(bonewagon.current_pos.x, bonewagon.current_pos.y, bonewagon.current_pos.z) bonewagon:setrot(bonewagon.current_rot.x, bonewagon.current_rot.y, bonewagon.current_rot.z) if not manny.is_driving then single_start_script(sg.glottis_roars, sg, bonewagon) end end if signpost.current_set == arg1 then signpost:put_in_set(arg1) signpost:setpos(signpost.current_pos.x, signpost.current_pos.y, signpost.current_pos.z) signpost:setrot(signpost.current_rot.x, signpost.current_rot.y, signpost.current_rot.z) end if manny.is_driving then single_start_sfx("bwIdle.IMU", IM_HIGH_PRIORITY, 0) fade_sfx("bwIdle.IMU", 1000, 127) end na:add_ambient_sfx({ "frstCrt1.wav", "frstCrt2.wav", "frstCrt3.wav", "frstCrt4.wav" }, { min_delay = 8000, max_delay = 20000 }) end na.exit = function(arg1) -- line 297 stop_script(na.footstep_monitor) manny:set_collision_mode(COLLISION_OFF) stop_script(sg.glottis_roars) glottis:shut_up() bonewagon:shut_up() stop_script(na.tilt_bonewagon) stop_script(bonewagon.cruise_sounds) stop_sound("bwIdle.IMU") end na.update_music_state = function(arg1) -- line 311 if manny.is_driving then return stateOO_BONE elseif nav_solved then return stateNA_SOLVED else return stateNA end end na.signpost = Object:create(na, "/natx002/sign post", 0, 0, 0, { range = 1.5 }) na.signpost.use_pnt_x = 0 na.signpost.use_pnt_y = 0 na.signpost.use_pnt_z = 0 na.signpost.use_rot_x = 0 na.signpost.use_rot_y = 0 na.signpost.use_rot_z = 0 na.signpost:make_untouchable() na.signpost.lookAt = function(arg1) -- line 336 na:examine_signpost() end na.signpost.pickUp = function(arg1) -- line 340 START_CUT_SCENE() signpost:set_collision_mode(COLLISION_OFF) manny:walkto_object(arg1) signpost:pick_up() sg.signpost:get() manny.is_holding = sg.signpost arg1:make_untouchable() if system.object_names_showing then system.currentSet:make_objects_visible() system.currentSet:update_object_names() end END_CUT_SCENE() end na.signpost.use = na.signpost.pickUp na.all_paths = Object:create(na, "/natx005/dark passage", 0, 0, 0, { range = 0 }) na.all_paths.lookAt = function(arg1) -- line 362 manny:say_line("/nama006/") end na.trapdoor = Object:create(na, "/natx007/opening", -1.8434, -1.82987, 0.51999998, { range = 2 }) na.trapdoor.use_pnt_x = -0.208358 na.trapdoor.use_pnt_y = -1.88557 na.trapdoor.use_pnt_z = 0.5 na.trapdoor.use_rot_x = 0 na.trapdoor.use_rot_y = 0 na.trapdoor.use_rot_z = 0 na.trapdoor.out_pnt_x = -0.209998 na.trapdoor.out_pnt_y = 1.02899 na.trapdoor.out_pnt_z = -0.86926502 na.trapdoor.out_rot_x = 0 na.trapdoor.out_rot_y = 0 na.trapdoor.out_rot_z = 0 na.trapdoor:make_untouchable() na.trapdoor.make_touchable = function(arg1) -- line 385 Object.make_touchable(arg1) if system.object_names_showing then na:update_object_names() end end na.trapdoor.lookAt = function(arg1) -- line 392 manny:say_line("/nama008/") end na.trapdoor.use = function(arg1) -- line 396 if not manny.is_driving then START_CUT_SCENE() manny:walkto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) lb:come_out_door(lb.na_door) END_CUT_SCENE() else na.glotdriv_trigr:walkOut() end end na.trapdoor.walkOut = na.trapdoor.use na.na_lb_box = na.trapdoor na.glotdriv_trigr = { name = "glotdriv_trigger" } na.glotdriv_trigr.walkOut = function(arg1) -- line 413 if manny.is_driving and na.trapdoor.touchable then START_CUT_SCENE() RunFullscreenMovie("glotdriv.snm") bonewagon:put_in_set(nil) lb:switch_to_set() lb:current_setup(lb_modws) END_CUT_SCENE() end end na.bone_wagon = Object:create(na, "/natx009/Bone Wagon", 0.97060001, -1.1162, 1.2, { range = 2.5 }) na.bone_wagon.use_pnt_x = 0.64422601 na.bone_wagon.use_pnt_y = -1.13239 na.bone_wagon.use_pnt_z = 0.5 na.bone_wagon.use_rot_x = 0 na.bone_wagon.use_rot_y = 645.83502 na.bone_wagon.use_rot_z = 0 na.bone_wagon:make_untouchable() na.bone_wagon.lookAt = function(arg1) -- line 437 sg.bone_wagon:lookAt() end na.bone_wagon.pickUp = function(arg1) -- line 441 sg.bone_wagon:pickUp() end na.bone_wagon.use = function(arg1) -- line 445 sg:get_in_BW() end na.bone_wagon.use_scythe = function(arg1) -- line 449 sg.bone_wagon:use_scythe() end na.bone_wagon.use_bone = function(arg1) -- line 453 sg.bone_wagon:use_bone() end na.sg_door = Object:create(na, "/natx010/door", 7.43084, -6.4731998, 0, { range = 0.5 }) na.sg_box = na.sg_door na.sg_door.use_pnt_x = 6.3092499 na.sg_door.use_pnt_y = -5.1433201 na.sg_door.use_pnt_z = 0.5 na.sg_door.use_rot_x = 0 na.sg_door.use_rot_y = 253 na.sg_door.use_rot_z = 0 na.sg_door.out_pnt_x = 7.43084 na.sg_door.out_pnt_y = -6.4731998 na.sg_door.out_pnt_z = 0.5 na.sg_door.out_rot_x = 0 na.sg_door.out_rot_y = -484.245 na.sg_door.out_rot_z = 0 na.sg_door.walkOut = function(arg1) -- line 481 sg:come_out_door(sg.na_door) end na.nav_points = { } na.nav_points.last_index = nil na.nav_points.walkOut = function(arg1) -- line 495 local local1, local2 START_CUT_SCENE() if system.currentActor == manny and get_generic_control_state("RUN") then system.currentActor:runto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) elseif system.currentActor == bonewagon then bonewagon:stop_movement_scripts() bonewagon:set_walk_rate(bonewagon.max_walk_rate) fade_sfx("bwIdle.IMU", 1000, 0) bonewagon:walkto(arg1.bonewagon_out_pnt_x, arg1.bonewagon_out_pnt_y, arg1.bonewagon_out_pnt_z) end system.currentActor:wait_for_actor() if system.currentActor == manny then manny:set_run(FALSE) end local2 = nil while local2 == nil do local1 = rndint(1, 12) if local1 ~= arg1.index and local1 ~= na.nav_points.last_index then if na.nav_points:away_from_signpost(local1) then local2 = na.nav_points[local1] na.nav_points.last_index = local1 end end break_here() end PrintDebug("out_door = " .. local1 .. "\n") if system.currentActor == manny then system.currentActor:setpos(local2.out_pnt_x, local2.out_pnt_y, local2.out_pnt_z) system.currentActor:runto(local2.use_pnt_x, local2.use_pnt_y, local2.use_pnt_z, local2.use_rot_x, local2.use_rot_y + 180, local2.use_rot_z) system.currentActor:wait_for_actor() elseif system.currentActor == bonewagon then bonewagon:stop_movement_scripts() single_start_sfx("bwIdle.IMU", IM_HIGH_PRIORITY, 0) fade_sfx("bwIdle.IMU", 1000, bonewagon.max_volume) system.currentActor:setpos(local2.bonewagon_out_pnt_x, local2.bonewagon_out_pnt_y, local2.bonewagon_out_pnt_z) system.currentActor:setrot(local2.bonewagon_out_rot_x, local2.bonewagon_out_rot_y + 180, local2.bonewagon_out_rot_z) bonewagon:driveto(local2.use_pnt_x, local2.use_pnt_y, local2.use_pnt_z) end if not na.nav_points.happened then na.nav_points.happened = TRUE manny:say_line("/nama001/") end END_CUT_SCENE() if get_generic_control_state("MOVE_FORWARD") then if manny.is_driving then single_start_script(bonewagon.gas, bonewagon) end end end na.nav_points.away_from_signpost = function(arg1, arg2) -- line 555 if signpost.current_set ~= na then return TRUE elseif proximity(signpost.hActor, arg1[arg2].bonewagon_out_pnt_x, arg1[arg2].bonewagon_out_pnt_y, arg1[arg2].bonewagon_out_pnt_z) < 10 then return FALSE else return TRUE end end na.nav_points[1] = { opened = TRUE, immediate = TRUE, index = 1 } na.nav_points[1].use_pnt_x = -1.6622699 na.nav_points[1].use_pnt_y = -4.6346402 na.nav_points[1].use_pnt_z = 0.5 na.nav_points[1].use_rot_x = 0 na.nav_points[1].use_rot_y = 146.248 na.nav_points[1].use_rot_z = 0 na.nav_points[1].out_pnt_x = -2.39167 na.nav_points[1].out_pnt_y = -5.4372802 na.nav_points[1].out_pnt_z = 0.5 na.nav_points[1].out_rot_x = 0 na.nav_points[1].out_rot_y = 135.17999 na.nav_points[1].out_rot_z = 0 na.nav_points[1].walkOut = na.nav_points.walkOut na.nav_points[2] = { opened = TRUE, immediate = TRUE, index = 2 } na.nav_points[2].use_pnt_x = -4.4720802 na.nav_points[2].use_pnt_y = -1.91714 na.nav_points[2].use_pnt_z = 0.5 na.nav_points[2].use_rot_x = 0 na.nav_points[2].use_rot_y = 133.786 na.nav_points[2].use_rot_z = 0 na.nav_points[2].out_pnt_x = -5.3769598 na.nav_points[2].out_pnt_y = -2.87236 na.nav_points[2].out_pnt_z = 0.5 na.nav_points[2].out_rot_x = 0 na.nav_points[2].out_rot_y = 497.70999 na.nav_points[2].out_rot_z = 0 na.nav_points[2].walkOut = na.nav_points.walkOut na.nav_points[3] = { opened = TRUE, immediate = TRUE, index = 3 } na.nav_points[3].use_pnt_x = -6.11096 na.nav_points[3].use_pnt_y = 1.9079601 na.nav_points[3].use_pnt_z = 0.5 na.nav_points[3].use_rot_x = 0 na.nav_points[3].use_rot_y = 122.553 na.nav_points[3].use_rot_z = 0 na.nav_points[3].out_pnt_x = -7.6507502 na.nav_points[3].out_pnt_y = 0.749448 na.nav_points[3].out_pnt_z = 0.5 na.nav_points[3].out_rot_x = 0 na.nav_points[3].out_rot_y = 490.267 na.nav_points[3].out_rot_z = 0 na.nav_points[3].walkOut = na.nav_points.walkOut na.nav_points[4] = { opened = TRUE, immediate = TRUE, index = 4 } na.nav_points[4].use_pnt_x = -4.50388 na.nav_points[4].use_pnt_y = 3.57882 na.nav_points[4].use_pnt_z = 0.5 na.nav_points[4].use_rot_x = 0 na.nav_points[4].use_rot_y = 771.30798 na.nav_points[4].use_rot_z = 0 na.nav_points[4].out_pnt_x = -7.9057798 na.nav_points[4].out_pnt_y = 5.7978601 na.nav_points[4].out_pnt_z = 0.5 na.nav_points[4].out_rot_x = 0 na.nav_points[4].out_rot_y = 771.30798 na.nav_points[4].out_rot_z = 0 na.nav_points[4].walkOut = na.nav_points.walkOut na.nav_points[5] = { opened = TRUE, immediate = TRUE, index = 5 } na.nav_points[5].use_pnt_x = -4.7105999 na.nav_points[5].use_pnt_y = 6.0127501 na.nav_points[5].use_pnt_z = 0.5 na.nav_points[5].use_rot_x = 0 na.nav_points[5].use_rot_y = 715.633 na.nav_points[5].use_rot_z = 0 na.nav_points[5].out_pnt_x = -4.6799002 na.nav_points[5].out_pnt_y = 9.6187496 na.nav_points[5].out_pnt_z = 0.5 na.nav_points[5].out_rot_x = 0 na.nav_points[5].out_rot_y = 715.633 na.nav_points[5].out_rot_z = 0 na.nav_points[5].walkOut = na.nav_points.walkOut na.nav_points[6] = { opened = TRUE, immediate = TRUE, index = 6 } na.nav_points[6].use_pnt_x = -1.34286 na.nav_points[6].use_pnt_y = 6.7671599 na.nav_points[6].use_pnt_z = 0.5 na.nav_points[6].use_rot_x = 0 na.nav_points[6].use_rot_y = 718.26202 na.nav_points[6].use_rot_z = 0 na.nav_points[6].out_pnt_x = -1.0425 na.nav_points[6].out_pnt_y = 10.6854 na.nav_points[6].out_pnt_z = 0.5 na.nav_points[6].out_rot_x = 0 na.nav_points[6].out_rot_y = 718.26202 na.nav_points[6].out_rot_z = 0 na.nav_points[6].walkOut = na.nav_points.walkOut na.nav_points[7] = { opened = TRUE, immediate = TRUE, index = 7 } na.nav_points[7].use_pnt_x = 2.0485799 na.nav_points[7].use_pnt_y = 8.4344902 na.nav_points[7].use_pnt_z = 0.5 na.nav_points[7].use_rot_x = 0 na.nav_points[7].use_rot_y = 691.46698 na.nav_points[7].use_rot_z = 0 na.nav_points[7].out_pnt_x = 3.0051601 na.nav_points[7].out_pnt_y = 10.2608 na.nav_points[7].out_pnt_z = 0.5 na.nav_points[7].out_rot_x = 0 na.nav_points[7].out_rot_y = 701.25702 na.nav_points[7].out_rot_z = 0 na.nav_points[7].walkOut = na.nav_points.walkOut na.nav_points[8] = { opened = TRUE, immediate = TRUE, index = 8 } na.nav_points[8].use_pnt_x = 4.70544 na.nav_points[8].use_pnt_y = 5.39078 na.nav_points[8].use_pnt_z = 0.5 na.nav_points[8].use_rot_x = 0 na.nav_points[8].use_rot_y = 1047.17 na.nav_points[8].use_rot_z = 0 na.nav_points[8].out_pnt_x = 6.5631399 na.nav_points[8].out_pnt_y = 8.34795 na.nav_points[8].out_pnt_z = 0.5 na.nav_points[8].out_rot_x = 0 na.nav_points[8].out_rot_y = 1047.17 na.nav_points[8].out_rot_z = 0 na.nav_points[8].walkOut = na.nav_points.walkOut na.nav_points[9] = { opened = TRUE, immediate = TRUE, index = 9 } na.nav_points[9].use_pnt_x = 7.8786502 na.nav_points[9].use_pnt_y = 3.7764101 na.nav_points[9].use_pnt_z = 0.5 na.nav_points[9].use_rot_x = 0 na.nav_points[9].use_rot_y = 1365.0601 na.nav_points[9].use_rot_z = 0 na.nav_points[9].out_pnt_x = 9.7726297 na.nav_points[9].out_pnt_y = 4.4060798 na.nav_points[9].out_pnt_z = 0.5 na.nav_points[9].out_rot_x = 0 na.nav_points[9].out_rot_y = 1376.39 na.nav_points[9].out_rot_z = 0 na.nav_points[9].walkOut = na.nav_points.walkOut na.nav_points[10] = { opened = TRUE, immediate = TRUE, index = 10 } na.nav_points[10].use_pnt_x = 8.5132399 na.nav_points[10].use_pnt_y = 0.23104601 na.nav_points[10].use_pnt_z = 0.5 na.nav_points[10].use_rot_x = 0 na.nav_points[10].use_rot_y = 1717.15 na.nav_points[10].use_rot_z = 0 na.nav_points[10].out_pnt_x = 10.8235 na.nav_points[10].out_pnt_y = 0.91224998 na.nav_points[10].out_pnt_z = 0.5 na.nav_points[10].out_rot_x = 0 na.nav_points[10].out_rot_y = 1733.52 na.nav_points[10].out_rot_z = 0 na.nav_points[10].walkOut = na.nav_points.walkOut na.nav_points[11] = { opened = TRUE, immediate = TRUE, index = 11 } na.nav_points[11].use_pnt_x = 8.0326595 na.nav_points[11].use_pnt_y = -2.3932199 na.nav_points[11].use_pnt_z = 0.5 na.nav_points[11].use_rot_x = 0 na.nav_points[11].use_rot_y = 2065.75 na.nav_points[11].use_rot_z = 0 na.nav_points[11].out_pnt_x = 10.7659 na.nav_points[11].out_pnt_y = -2.5953 na.nav_points[11].out_pnt_z = 0.5 na.nav_points[11].out_rot_x = 0 na.nav_points[11].out_rot_y = 2065.75 na.nav_points[11].out_rot_z = 0 na.nav_points[11].walkOut = na.nav_points.walkOut na.nav_points[12] = { opened = TRUE, immediate = TRUE, index = 12 } na.nav_points[12].use_pnt_x = 1.89314 na.nav_points[12].use_pnt_y = -6.4507098 na.nav_points[12].use_pnt_z = 0.5 na.nav_points[12].use_rot_x = 0 na.nav_points[12].use_rot_y = 165.52 na.nav_points[12].use_rot_z = 0 na.nav_points[12].out_pnt_x = 1.55873 na.nav_points[12].out_pnt_y = -7.7474899 na.nav_points[12].out_pnt_z = 0.5 na.nav_points[12].out_rot_x = 0 na.nav_points[12].out_rot_y = 165.52 na.nav_points[12].out_rot_z = 0 na.nav_points[12].walkOut = na.nav_points.walkOut na.nav_points[1].bonewagon_out_pnt_x = -4.7062402 na.nav_points[1].bonewagon_out_pnt_y = -7.51126 na.nav_points[1].bonewagon_out_pnt_z = 0.5 na.nav_points[1].bonewagon_out_rot_x = 0 na.nav_points[1].bonewagon_out_rot_y = 139.108 na.nav_points[1].bonewagon_out_rot_z = 0 na.nav_points[2].bonewagon_out_pnt_x = -7.99891 na.nav_points[2].bonewagon_out_pnt_y = -4.9516501 na.nav_points[2].bonewagon_out_pnt_z = 0.5 na.nav_points[2].bonewagon_out_rot_x = 0 na.nav_points[2].bonewagon_out_rot_y = 136.179 na.nav_points[2].bonewagon_out_rot_z = 0 na.nav_points[3].bonewagon_out_pnt_x = -10.0029 na.nav_points[3].bonewagon_out_pnt_y = -1.71706 na.nav_points[3].bonewagon_out_pnt_z = 0.5 na.nav_points[3].bonewagon_out_rot_x = 0 na.nav_points[3].bonewagon_out_rot_y = 130.61099 na.nav_points[3].bonewagon_out_rot_z = 0 na.nav_points[4].bonewagon_out_pnt_x = -11.9683 na.nav_points[4].bonewagon_out_pnt_y = 7.9263301 na.nav_points[4].bonewagon_out_pnt_z = 0.5 na.nav_points[4].bonewagon_out_rot_x = 0 na.nav_points[4].bonewagon_out_rot_y = 57.449501 na.nav_points[4].bonewagon_out_rot_z = 0 na.nav_points[5].bonewagon_out_pnt_x = -4.9099998 na.nav_points[5].bonewagon_out_pnt_y = 18.455 na.nav_points[5].bonewagon_out_pnt_z = 0.5 na.nav_points[5].bonewagon_out_rot_x = 0 na.nav_points[5].bonewagon_out_rot_y = -40.159 na.nav_points[5].bonewagon_out_rot_z = 0 na.nav_points[6].bonewagon_out_pnt_x = -0.40590999 na.nav_points[6].bonewagon_out_pnt_y = 18.074301 na.nav_points[6].bonewagon_out_pnt_z = 0.5 na.nav_points[6].bonewagon_out_rot_x = 0 na.nav_points[6].bonewagon_out_rot_y = 357.64999 na.nav_points[6].bonewagon_out_rot_z = 0 na.nav_points[7].bonewagon_out_pnt_x = 5.2837901 na.nav_points[7].bonewagon_out_pnt_y = 17.2509 na.nav_points[7].bonewagon_out_pnt_z = 0.5 na.nav_points[7].bonewagon_out_rot_x = 0 na.nav_points[7].bonewagon_out_rot_y = 698.73297 na.nav_points[7].bonewagon_out_rot_z = 0 na.nav_points[8].bonewagon_out_pnt_x = 10.8676 na.nav_points[8].bonewagon_out_pnt_y = 15.5262 na.nav_points[8].bonewagon_out_pnt_z = 0.5 na.nav_points[8].bonewagon_out_rot_x = 0 na.nav_points[8].bonewagon_out_rot_y = 1410.5 na.nav_points[8].bonewagon_out_rot_z = 0 na.nav_points[9].bonewagon_out_pnt_x = 16.0665 na.nav_points[9].bonewagon_out_pnt_y = 7.8298802 na.nav_points[9].bonewagon_out_pnt_z = 0.5 na.nav_points[9].bonewagon_out_rot_x = 0 na.nav_points[9].bonewagon_out_rot_y = 1737.46 na.nav_points[9].bonewagon_out_rot_z = 0 na.nav_points[10].bonewagon_out_pnt_x = 16.580601 na.nav_points[10].bonewagon_out_pnt_y = 0.45177901 na.nav_points[10].bonewagon_out_pnt_z = 0.5 na.nav_points[10].bonewagon_out_rot_x = 0 na.nav_points[10].bonewagon_out_rot_y = 2072.22 na.nav_points[10].bonewagon_out_rot_z = 0 na.nav_points[11].bonewagon_out_pnt_x = 15.2199 na.nav_points[11].bonewagon_out_pnt_y = -3.3735099 na.nav_points[11].bonewagon_out_pnt_z = 0.5 na.nav_points[11].bonewagon_out_rot_x = 0 na.nav_points[11].bonewagon_out_rot_y = 2407.49 na.nav_points[11].bonewagon_out_rot_z = 0 na.nav_points[12].bonewagon_out_pnt_x = -0.120106 na.nav_points[12].bonewagon_out_pnt_y = -11.213 na.nav_points[12].bonewagon_out_pnt_z = 0.5 na.nav_points[12].bonewagon_out_rot_x = 0 na.nav_points[12].bonewagon_out_rot_y = 151.653 na.nav_points[12].bonewagon_out_rot_z = 0 na.path1 = na.nav_points[1] na.path2 = na.nav_points[2] na.path3 = na.nav_points[3] na.path4 = na.nav_points[4] na.path5 = na.nav_points[5] na.path6 = na.nav_points[6] na.path7 = na.nav_points[7] na.path8 = na.nav_points[8] na.path9 = na.nav_points[9] na.path10 = na.nav_points[10] na.path11 = na.nav_points[11] na.path12 = na.nav_points[12] na.writenavpoint = function(arg1, arg2) -- line 855 local local1 local local2, local3 local1 = InputDialog("Nav points", "Index:") local1 = tonumber(local1) if na.nav_points[local1] == nil then na.nav_points[local1] = { } end local2 = manny:getpos() local3 = manny:getrot() if arg2 then na.nav_points[local1].use_pos = local2 na.nav_points[local1].use_rot = local3 else na.nav_points[local1].out_pos = local2 na.nav_points[local1].out_rot = local3 end PrintDebug("Got nav " .. local1 .. "\n") writeto("navpoints.txt") local1 = 0 while local1 < 12 do if na.nav_points[local1] then write("na.nav_points[" .. local1 .. "] = {}\n") if na.nav_points[local1].use_pos then write("na.nav_points[" .. local1 .. "].use_pnt_x = " .. na.nav_points[local1].use_pos.x .. "\n") write("na.nav_points[" .. local1 .. "].use_pnt_y = " .. na.nav_points[local1].use_pos.y .. "\n") write("na.nav_points[" .. local1 .. "].use_pnt_z = " .. na.nav_points[local1].use_pos.z .. "\n") end if na.nav_points[local1].use_rot then write("na.nav_points[" .. local1 .. "].use_rot_x = " .. na.nav_points[local1].use_rot.x .. "\n") write("na.nav_points[" .. local1 .. "].use_rot_y = " .. na.nav_points[local1].use_rot.y .. "\n") write("na.nav_points[" .. local1 .. "].use_rot_z = " .. na.nav_points[local1].use_rot.z .. "\n") end if na.nav_points[local1].out_pos then write("na.nav_points[" .. local1 .. "].out_pnt_x = " .. na.nav_points[local1].out_pos.x .. "\n") write("na.nav_points[" .. local1 .. "].out_pnt_y = " .. na.nav_points[local1].out_pos.y .. "\n") write("na.nav_points[" .. local1 .. "].out_pnt_z = " .. na.nav_points[local1].out_pos.z .. "\n") end if na.nav_points[local1].out_rot then write("na.nav_points[" .. local1 .. "].out_rot_x = " .. na.nav_points[local1].out_rot.x .. "\n") write("na.nav_points[" .. local1 .. "].out_rot_y = " .. na.nav_points[local1].out_rot.y .. "\n") write("na.nav_points[" .. local1 .. "].out_rot_z = " .. na.nav_points[local1].out_rot.z .. "\n") end end local1 = local1 + 1 end writeto() end NavButtonHandler = function(arg1, arg2, arg3) -- line 909 if arg1 == UKEY and arg2 then na:writenavpoint(TRUE) elseif arg1 == OKEY and arg2 then na:writenavpoint(FALSE) else SampleButtonHandler(arg1, arg2, arg3) end end CheckFirstTime("ly.lua") dofile("br_idles.lua") dofile("cc_taplook.lua") dofile("cc_play_slot.lua") dofile("meche_seduction.lua") dofile("cc_seduction.lua") dofile("unicycle_man.lua") dofile("ly_slot_door.lua") dofile("msb_msb_sheet.lua") dofile("meche_ruba.lua") dofile("cc_toga.lua") dofile("mi_with_cc_toga.lua") dofile("ly_cc_sheet.lua") ly = Set:create("ly.set", "le mans lobby", { ly_top = 0, ly_intha = 1, ly_intha1 = 1, ly_intha2 = 1, ly_intha3 = 1, ly_intha4 = 1, ly_intha5 = 1, ly_intha6 = 1, ly_intha7 = 1, ly_sltha = 2, ly_chaws = 3, ly_elems = 4, ly_kenla = 5, ly_lavha = 6 }) ly.unicycle_roll_min_vol = 5 ly.unicycle_roll_max_vol = 20 slot_wheel = { parent = Actor } slot_wheel.pitch = { } slot_wheel.pitch[1] = { 30, 105, 175, 280 } slot_wheel.pitch[2] = { 140, 210, 315 } slot_wheel.pitch[3] = { 65, 245 } slot_wheel.pitch[4] = { 350 } slot_wheel.create = function(arg1) -- line 42 local local1 local local2 local1 = Actor:create(nil, nil, nil, "slot wheel") local1.parent = arg1 local2 = rndint(1, 4) local1.cur_pitch = arg1.pitch[local2][1] local1.slot = FALSE return local1 end slot_wheel.default = function(arg1) -- line 55 arg1:set_costume("ly_slotwheel.cos") arg1:put_in_set(ly) arg1:setrot(arg1.cur_pitch, 270, 90) end slot_wheel.spin = function(arg1) -- line 61 local local1 local local2 local local3 local local4 = { "ly_wlsp1.WAV", "ly_wlsp2.WAV", "ly_wlsp3.WAV" } local2 = arg1:get_positive_rot() local1 = 10 arg1.slot = nil while arg1.slot == nil do arg1:setrot(arg1.cur_pitch, local2.y, local2.z) arg1.cur_pitch = arg1.cur_pitch - local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end if local1 < 60 then local1 = local1 + 1 end break_here() end local3 = FALSE while not local3 do if local1 > 5 then local1 = local1 - 1 end arg1.cur_pitch = arg1.cur_pitch + local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end arg1:setrot(arg1.cur_pitch, local2.y, local2.z) if arg1:check_match() then local3 = TRUE else break_here() end end arg1:play_sound_at(pick_one_of(local4, TRUE)) end slot_wheel.scramble_to_win = function(arg1) -- line 107 local local1 local local2, local3 arg1.slot = 4 local2 = arg1:get_positive_rot() if rnd(5) then local1 = 5 else local1 = -5 end local3 = FALSE arg1.cur_pitch = local2.x while not local3 do arg1.cur_pitch = arg1.cur_pitch + local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end arg1:setrot(arg1.cur_pitch, local2.y, local2.z) if arg1:check_match() then local3 = TRUE else break_here() end end end slot_wheel.check_match = function(arg1) -- line 137 local local1, local2 local local3 local3 = FALSE local1, local2 = next(arg1.pitch[arg1.slot], nil) while local1 and not local3 do if abs(local2 - arg1.cur_pitch) < 5 then local3 = TRUE end local1, local2 = next(arg1.pitch[arg1.slot], local1) end return local3 end slot_machine = { } slot_machine.create = function(arg1) -- line 156 local local1 local1 = { } local1.parent = arg1 local1.actors = { } local1.pos = { } local1.rot = nil local1.spinning = FALSE return local1 end slot_machine.create_wheels = function(arg1) -- line 169 local local1 if not arg1.actors then arg1.actors = { } end local1 = 1 while local1 <= 3 do if not arg1.actors[local1] then arg1.actors[local1] = slot_wheel:create() end local1 = local1 + 1 end end slot_machine.free = function(arg1) -- line 185 if arg1.actors then if arg1.actors[1] then arg1.actors[1]:free() end if arg1.actors[2] then arg1.actors[2]:free() end if arg1.actors[3] then arg1.actors[3]:free() end end arg1.actors = nil end slot_machine.default = function(arg1) -- line 200 local local1 arg1:create_wheels() local1 = 1 while local1 <= 3 do arg1.actors[local1]:default() arg1.actors[local1]:setpos(arg1.pos[local1].x, arg1.pos[local1].y, arg1.pos[local1].z) if arg1.rot then arg1.actors[local1]:setrot(arg1.rot.x, arg1.rot.y, arg1.rot.z) end local1 = local1 + 1 end end slot_machine.spin = function(arg1) -- line 216 arg1.spin_scripts = { } arg1.spinning = TRUE arg1.wheel_sound = arg1.actors[1]:play_sound_at("ly_wheel.IMU", 10, 80) arg1.spin_scripts[1] = start_script(arg1.actors[1].spin, arg1.actors[1]) break_here() arg1.spin_scripts[2] = start_script(arg1.actors[2].spin, arg1.actors[2]) break_here() arg1.spin_scripts[3] = start_script(arg1.actors[3].spin, arg1.actors[3]) end slot_machine.scramble_to_win = function(arg1) -- line 229 local local1, local2, local3 local1 = start_script(arg1.actors[1].scramble_to_win, arg1.actors[1]) local2 = start_script(arg1.actors[2].scramble_to_win, arg1.actors[2]) local3 = start_script(arg1.actors[3].scramble_to_win, arg1.actors[3]) wait_for_script(local1) wait_for_script(local2) wait_for_script(local3) end slot_machine.stop = function(arg1, arg2) -- line 239 local local1 local local2 if arg1.spinning then local1 = FALSE local2 = { } repeat local2[1] = rndint(1, 4) local2[2] = rndint(1, 4) local2[3] = rndint(1, 4) if not arg2 then if local2[1] == local2[2] and local2[2] == local2[3] then local1 = FALSE else local1 = TRUE end elseif local2[1] == local2[2] and local2[2] == local2[3] then local1 = TRUE else local1 = FALSE end if not local1 then break_here() end until local1 arg1.actors[1].slot = local2[1] if arg1.spin_scripts[1] then wait_for_script(arg1.spin_scripts[1]) end sleep_for(100) arg1.actors[2].slot = local2[2] if arg1.spin_scripts[2] then wait_for_script(arg1.spin_scripts[2]) end sleep_for(100) arg1.actors[3].slot = local2[3] if arg1.spin_scripts[3] then wait_for_script(arg1.spin_scripts[3]) end end arg1.spinning = FALSE stop_sound("ly_wheel.IMU") arg1.spin_scripts = nil end slot_machine.freeze = function(arg1) -- line 295 arg1.actors[1]:freeze() arg1.actors[2]:freeze() arg1.actors[3]:freeze() end slot_machine.thaw = function(arg1, arg2) -- line 301 arg1.actors[1]:thaw(arg2) arg1.actors[2]:thaw(arg2) arg1.actors[3]:thaw(arg2) end ly.slot_handle = { } ly.slot_handle.parent = Actor ly.slot_handle.create = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 312 local local1 local1 = Actor:create(nil, nil, nil, "handle") local1.parent = ly.slot_handle if arg2 then local1.pos = { } local1.pos.x = arg2 local1.pos.y = arg3 local1.pos.z = arg4 end if arg5 then local1.rot = { } local1.rot.x = arg5 local1.rot.y = arg6 local1.rot.z = arg7 end return local1 end ly.slot_handle.default = function(arg1) -- line 333 arg1:put_in_set(ly) arg1:set_costume("ly_slothandle.cos") arg1:play_chore(1) if arg1.pos then arg1:setpos(arg1.pos.x, arg1.pos.y, arg1.pos.z) end if arg1.rot then arg1:setrot(arg1.rot.x, arg1.rot.y, arg1.rot.z) end end ly.slot_handle.init = function(arg1) -- line 345 if not arg1[1] then arg1[1] = ly.slot_handle:create(0.63847, 0.401519, 0.006, 0, 0, 0) end if not arg1[2] then arg1[2] = ly.slot_handle:create(1.05447, 0.401519, 0.006, 0, 0, 0) end if not arg1[3] then arg1[3] = ly.slot_handle:create(1.82115, -0.135567, 0.015, 0, 270, 0) end if not arg1[4] then arg1[4] = ly.slot_handle:create(1.82285, -0.541493, 0.013, 0, 270, 0) end arg1[1]:default() arg1[2]:default() arg1[3]:default() arg1[4]:default() arg1[4]:set_visibility(FALSE) arg1[1]:freeze() arg1[2]:freeze() end ly.slot_handle.free = function(arg1) -- line 369 if arg1[1] then arg1[1]:free() end if arg1[2] then arg1[2]:free() end if arg1[3] then arg1[3]:free() end end charlies_slot = slot_machine:create() charlies_slot.pos[1] = { x = 2.1475301, y = -0.416738, z = 0.44400001 } charlies_slot.pos[2] = { x = 2.1475301, y = -0.492737, z = 0.44400001 } charlies_slot.pos[3] = { x = 2.1475301, y = -0.569736, z = 0.44400001 } mannys_slot = slot_machine:create() mannys_slot.pos[1] = { x = 2.1358399, y = -0.0144972, z = 0.44499999 } mannys_slot.pos[2] = { x = 2.1358399, y = -0.0924972, z = 0.44499999 } mannys_slot.pos[3] = { x = 2.1358399, y = -0.169497, z = 0.44499999 } ly.keno_actor = Actor:create(nil, nil, nil, "keno board") ly.keno_actor.current_number = nil ly.keno_actor.current_game = nil ly.keno_actor.game_index = 1 ly.keno_actor.game_paused = FALSE ly.keno_actor.default = function(arg1) -- line 417 arg1:set_costume("ly_keno.cos") arg1:put_in_set(ly) arg1:setpos(-0.0558433, -0.0978411, 2.801) arg1:set_visibility(TRUE) end ly.keno_actor.game = function(arg1) -- line 424 while TRUE do arg1:clear_game() while arg1.game_index < 10 do if not arg1.game_paused then arg1:choose_number() end sleep_for(15000) end break_here() end end ly.keno_actor.clear_game = function(arg1) -- line 437 arg1.current_game = { } arg1.game_index = 0 arg1.current_number = nil arg1:complete_chore(32) end ly.keno_actor.choose_number = function(arg1) -- line 444 local local1, local2 local2 = TRUE while local2 do local1 = rndint(1, 32) if not arg1:find_number(local1) then local2 = FALSE else break_here() end end arg1.game_index = arg1.game_index + 1 arg1.current_game[arg1.game_index] = local1 arg1.current_number = local1 arg1:complete_chore(local1 - 1) arg1:play_sound_at("ly_keno.wav", 10, 70) end ly.keno_actor.find_number = function(arg1, arg2) -- line 463 local local1, local2 local2 = FALSE local1 = 1 while local1 <= arg1.game_index and not local2 do if arg1.current_game[local1] == arg2 then local2 = TRUE end local1 = local1 + 1 end return local2 end unicycle_man.point = { } unicycle_man.point[0] = { } unicycle_man.point[0].pos = { x = 0.89800102, y = 0.39131901, z = 0 } unicycle_man.point[0].rot = { x = 0, y = 0, z = 0 } unicycle_man.point[1] = { } unicycle_man.point[1].pos = { x = 0.49000099, y = 0.394319, z = 0 } unicycle_man.point[1].rot = { x = 0, y = 0, z = 0 } unicycle_man.point.mid = { } unicycle_man.point["mid"].pos = { x = 0.74000102, y = 0.090319097, z = 0 } unicycle_man.point["mid"].rot = { x = 0, y = 0, z = 0 } unicycle_man.point.charlie = { } unicycle_man.point["charlie"].pos = { x = 1.84929, y = -0.39064199, z = 0 } unicycle_man.point["charlie"].rot = { x = 0, y = 270.01999, z = 0 } unicycle_man.cur_point = 0 unicycle_man.save_pos = function(arg1) -- line 499 arg1.current_pos = arg1:getpos() arg1.current_rot = arg1:getrot() end unicycle_man.restore_pos = function(arg1) -- line 504 local local1 if arg1.current_pos then arg1:setpos(arg1.current_pos.x, arg1.current_pos.y, arg1.current_pos.z) arg1:setrot(arg1.current_rot.x, arg1.current_rot.y, arg1.current_rot.z) else local1 = arg1.point[arg1.cur_point] arg1:setpos(local1.pos.x, local1.pos.y, local1.pos.z) arg1:setrot(local1.rot.x, local1.rot.y, local1.rot.z) end end unicycle_man.cycle_to = function(arg1, arg2, arg3) -- line 517 local local1 local1 = GetActorYawToPoint(arg1.hActor, arg1.point.mid.pos) local1 = local1 + 180 arg1:set_turn_rate(120) if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end arg1:setrot(0, local1, 0, TRUE) arg1:stop_chore(unicycle_man_idles) arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(-0.30000001) while proximity(arg1.hActor, arg1.point.mid.pos.x, arg1.point.mid.pos.y, arg1.point.mid.pos.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end local1 = GetActorYawToPoint(arg1.hActor, arg2) arg1:stop_chore(unicycle_man_roll) arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(0, local1, 0, TRUE) arg1:wait_for_actor() arg1:stop_chore(unicycle_man_idles) arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(0.30000001) while proximity(arg1.hActor, arg2.x, arg2.y, arg2.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end arg1:setpos(arg2.x, arg2.y, arg2.z) arg1:stop_chore(unicycle_man_roll) stop_sound("um_roll.IMU") arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(arg3.x, arg3.y, arg3.z, TRUE) end unicycle_man.cycle_straight_to = function(arg1, arg2, arg3) -- line 564 local local1 local1 = GetActorYawToPoint(arg1.hActor, arg2) arg1:set_turn_rate(120) arg1:stop_chore(unicycle_man_idles) if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(0.30000001) arg1:setrot(0, local1, 0, TRUE) while proximity(arg1.hActor, arg2.x, arg2.y, arg2.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end arg1:setpos(arg2.x, arg2.y, arg2.z) arg1:stop_chore(unicycle_man_roll) stop_sound("um_roll.IMU") arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(arg3.x, arg3.y, arg3.z, TRUE) end unicycle_man.turn_to_manny = function(arg1) -- line 591 local local1, local2 local2 = manny:getpos() if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end local1 = GetActorYawToPoint(arg1.hActor, local2) arg1:setrot(0, local1, 0, TRUE) arg1:wait_for_actor() stop_sound("um_roll.IMU") end ly.agent_talk_count = 0 ly.talk_to_agent = function(arg1) -- line 610 local local1 = TRUE local local2 = FALSE local local3, local4 START_CUT_SCENE() start_script(ly.unicycle_stop_idles, ly) manny:set_collision_mode(COLLISION_OFF) ly.agent_talk_count = ly.agent_talk_count + 1 if ly.agent_talk_count == 1 then ly.met_agent = TRUE manny:say_line("/lyma066/") manny:wait_for_message() unicycle_man:say_line("/lyum067/") unicycle_man:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:say_line("/lyum068/") unicycle_man:wait_for_message() local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) manny:tilt_head_gesture(TRUE) manny:point_gesture(TRUE) manny:say_line("/lyma069/") manny:wait_for_message() unicycle_man:say_line("/lyum070/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum071/") unicycle_man:wait_for_message() elseif ly.agent_talk_count == 2 then manny:say_line("/lyma072/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) unicycle_man:say_line("/lyum073/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum074/") unicycle_man:wait_for_message() manny:say_line("/lyma075/") elseif ly.meche_talk_count < 2 then manny:say_line("/lyma076/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:turn_to_manny() unicycle_man:say_line("/lyum077/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum078/") unicycle_man:wait_for_message() local2 = TRUE elseif not ly.charlie_on_floor then manny:say_line("/lyma079/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:turn_to_manny() unicycle_man:say_line("/lyum080/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum081/") unicycle_man:wait_for_message() else local1 = FALSE start_script(ly.charlies_jackpot) end END_CUT_SCENE() manny:set_collision_mode(COLLISION_OFF) if local1 then start_script(ly.unicycle_idles, ly, local2) end end ly.unicycle_idles = function(arg1, arg2) -- line 708 local local1, local2 unicycle_man.in_machine = FALSE unicycle_man.rolling = FALSE while TRUE do break_here() ly:track_unicycle_man() if not arg2 then local1 = unicycle_man.cur_point + 1 if not unicycle_man.point[local1] then local1 = 0 end unicycle_man.cur_point = local1 unicycle_man.rolling = TRUE start_script(unicycle_man.cycle_to, unicycle_man, unicycle_man.point[local1].pos, unicycle_man.point[local1].rot) while find_script(unicycle_man.cycle_to) do break_here() ly:track_unicycle_man() end unicycle_man.rolling = FALSE sleep_for(10000) else local1 = unicycle_man.cur_point unicycle_man:setrot(unicycle_man.point[local1].rot.x, unicycle_man.point[local1].rot.y, unicycle_man.point[local1].rot.z, TRUE) unicycle_man:wait_for_actor() end unicycle_man:set_chore_looping(unicycle_man_idles, FALSE) unicycle_man:wait_for_chore(unicycle_man_idles) unicycle_man.in_machine = TRUE unicycle_man:run_chore(unicycle_man_crawl_slot) start_script(ly.unicycle_slot_sfx) sleep_for(rndint(6000, 9000)) unicycle_man:play_sound_at("ly_pyoff.IMU", 80, 110) unicycle_man:run_chore(unicycle_man_out_slot) fade_sfx("ly_pyoff.IMU", 200) unicycle_man:play_chore_looping(unicycle_man_idles) unicycle_man.in_machine = FALSE sleep_for(10000) end end ly.unicycle_stop_idles = function(arg1) -- line 762 stop_sound("ly_pyoff.IMU") stop_script(ly.unicycle_idles) if unicycle_man.rolling then while find_script(unicycle_man.cycle_to) do break_here() ly:track_unicycle_man() end unicycle_man.rolling = FALSE elseif unicycle_man.in_machine then if unicycle_man:is_choring(unicycle_man_crawl_slot) then unicycle_man:wait_for_chore(unicycle_man_crawl_slot) unicycle_man:run_chore(unicycle_man_out_slot) elseif unicycle_man:is_choring(unicycle_man_out_slot) then unicycle_man:wait_for_chore(unicycle_man_out_slot) else unicycle_man:run_chore(unicycle_man_out_slot) end end unicycle_man:play_chore_looping(unicycle_man_idles) end ly.track_unicycle_man = function(arg1) -- line 788 local local1 local1 = unicycle_man:getpos() ly.unicycle_man.obj_x = local1.x ly.unicycle_man.obj_y = local1.y ly.unicycle_man.obj_z = local1.z + 0.40000001 ly.unicycle_man.interest_actor:put_in_set(ly) ly.unicycle_man.interest_actor:setpos(ly.unicycle_man.obj_x, ly.unicycle_man.obj_y, ly.unicycle_man.obj_z) if hot_object == ly.unicycle_man then system.currentActor:head_look_at(ly.unicycle_man) end end ly.unicycle_slot_sfx = function(arg1) -- line 802 local local1 = { "um_swit1.wav", "um_swit2.wav", "um_swit3.wav" } sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) end ly.brennis_idle_table = Idle:create("br_idles") idt = ly.brennis_idle_table idt:add_state("rest", { rest = 0.97000003, looks = 0.0099999998, moves_head = 0.0099999998, scrtch_chst = 0.0099999998 }) idt:add_state("looks", { rest = 1 }) idt:add_state("moves_head", { rest = 1 }) idt:add_state("scrtch_chst", { rest = 1 }) ly.brennis_talk_count = 0 ly.brennis_stop_idle = function(arg1) -- line 830 stop_script(brennis.ly_idle_script) brennis.ly_idle_script = nil brennis:wait_for_chore() brennis:play_chore(br_idles_rest) end ly.brennis_start_idle = function(arg1) -- line 837 brennis:stop_chore() brennis.ly_idle_script = start_script(brennis.new_run_idle, brennis, "rest", ly.brennis_idle_table, "br_idles.cos") end ly.talk_clothes_with_brennis = function(arg1) -- line 842 START_CUT_SCENE() ly.brennis_talk_count = ly.brennis_talk_count + 1 start_script(ly.brennis_stop_idle, ly) if ly.brennis_talk_count == 1 then ly:current_setup(ly_kenla) sleep_for(1500) manny:tilt_head_gesture() manny:say_line("/lyma012/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_bar_door, "br_idles.cos") brennis:say_line("/lybs013/") brennis:wait_for_message() brennis:say_line("/lybs014/") elseif ly.brennis_talk_count == 2 then ly:current_setup(ly_kenla) manny:shrug_gesture() manny:say_line("/lyma015/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_scrtch_chst, "br_idles.cos") brennis:say_line("/lybs016/") brennis:wait_for_message() ly:current_setup(ly_kenla) manny:say_line("/lyma017/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs018/") elseif ly.brennis_talk_count == 3 then ly:current_setup(ly_kenla) manny:hand_gesture() manny:say_line("/lyma019/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs020/") brennis:wait_for_message() brennis:say_line("/lybs021/") brennis:wait_for_message() brennis:say_line("/lybs022/") brennis:wait_for_message() elseif ly.brennis_talk_count == 4 then ly:current_setup(ly_kenla) manny:hand_gesture() manny:say_line("/lyma023/") manny:wait_for_message() manny:tilt_head_gesture() manny:say_line("/lyma024/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_bar_door, "br_idles.cos") brennis:say_line("/lybs025/") brennis:wait_for_message() brennis:say_line("/lybs026/") brennis:wait_for_chore(br_idles_bar_door, "br_idles.cos") elseif ly.brennis_talk_count == 5 then ly:current_setup(ly_kenla) manny:point_gesture() manny:say_line("/lyma027/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs028/") brennis:wait_for_message() brennis:say_line("/lybs029/") brennis:wait_for_message() brennis:say_line("/lybs030/") brennis:wait_for_message() ly:current_setup(ly_kenla) manny:say_line("/lyma031/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs032/") else ly:current_setup(ly_kenla) manny:twist_head_gesture() manny:say_line("/lyma033/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs034/") end END_CUT_SCENE() brennis:wait_for_chore() ly:brennis_start_idle() end ly.meche_talk_count = 0 ly.gun_control = function() -- line 947 while TRUE do break_here() if manny.is_holding == fi.gun and system.currentSet == ly then START_CUT_SCENE() wait_for_script(open_inventory) wait_for_script(close_inventory) manny:clear_hands() manny:say_line("/lyma003/") manny:wait_for_message() manny:say_line("/lyma004/") END_CUT_SCENE() end end end ly.playslots = function(arg1, arg2) -- line 963 START_CUT_SCENE() manny:walkto(1.8283, -0.263458, 0, 0, 292.582, 0) manny:wait_for_actor() manny:head_look_at(nil) ly.slot_handle[3]:thaw(TRUE) mannys_slot:thaw(TRUE) ly.slot_handle[3]:play_chore(0) sleep_for(50) manny:play_chore(msb_reach_cabinet, manny.base_costume) sleep_for(500) mannys_slot:spin() sleep_for(500) manny:head_look_at(ly.slot1) if not ly.played then ly.played = TRUE manny:say_line("/lyma006/") wait_for_message() manny:say_line("/lyma007/") wait_for_message() end manny:wait_for_chore(msb_reach_cabinet, manny.base_costume) manny:stop_chore(msb_reach_cabinet, manny.base_costume) manny:head_look_at(ly.slot1) ly.slot_handle[3]:wait_for_chore(0) ly.slot_handle[3]:freeze() if rnd() then mannys_slot:stop(FALSE) if not ly.lost then ly.lost = TRUE manny:say_line("/lyma008/") end else mannys_slot:stop(TRUE) manny:say_line("/lyma009/") if not ly.won then ly.won = TRUE manny:wait_for_message() manny:head_look_at_point(1.89026, -0.0954438, 0) manny:say_line("/lyma010/") manny:wait_for_message() manny:say_line("/lyma011/") end end END_CUT_SCENE() manny:head_look_at(nil) mannys_slot:freeze() end ly.talk_clothes_with_meche = function(arg1) -- line 1019 START_CUT_SCENE() if ly.charlie_on_floor then meche:say_line("/lymc005/") else ly.meche_talk_count = ly.meche_talk_count + 1 if ly.meche_talk_count == 1 then single_start_script(ly.seduce_charlie, ly) manny:say_line("/lyma035/") manny:wait_for_message() meche:say_line("/lymc036/") elseif ly.meche_talk_count == 2 then manny:walkto_object(ly.meche_obj) manny:wait_for_actor() if find_script(ly.seduce_charlie) and ly.meche_obj.touchable then stop_script(ly.seduce_charlie) end manny:say_line("/lyma037/") manny:wait_for_message() while not ly.meche_obj.touchable do break_here() end meche:say_line("/lymc038/") meche:wait_for_message() meche:say_line("/lymc039/") meche:wait_for_message() meche:say_line("/lymc040/") ly:manny_take_sheet_from_meche() elseif ly.meche_talk_count == 3 then manny:say_line("/lyma041/") manny:wait_for_message() meche:say_line("/lymc042/") meche:wait_for_message() meche:say_line("/lymc043/") if manny.is_holding ~= ly.sheet then ly:manny_take_sheet_from_meche() end meche:wait_for_message() manny:say_line("/lyma044/") else manny:say_line("/lyma045/") manny:wait_for_message() meche:say_line("/lymc046/") if manny.is_holding ~= ly.sheet then ly:manny_take_sheet_from_meche() end end end END_CUT_SCENE() end ly.manny_take_sheet_from_meche = function(arg1) -- line 1071 manny:walkto_object(ly.meche_obj) manny:wait_for_actor() if meche:is_choring(meche_seduction_mec_sed_ch, FALSE, "meche_seduction.cos") then meche:wait_for_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") end stop_script(ly.seduce_charlie) stop_script(ly.meche_idles) meche:stop_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:play_chore(0, "mi_msb_sheet.cos") manny:push_costume("msb_msb_sheet.cos") manny:setrot(0, 231.446, 0) manny:play_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") ly.sheet:get() manny.is_holding = ly.sheet meche:wait_for_chore(0, "mi_msb_sheet.cos") meche:stop_chore(0, "mi_msb_sheet.cos") meche:play_chore(meche_ruba_hands_down_hold, "meche_ruba.cos") manny:wait_for_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") manny:stop_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") manny:run_chore(msb_msb_sheet_to_hold_pos, "msb_msb_sheet.cos") manny:stop_chore(msb_msb_sheet_to_hold_pos, "msb_msb_sheet.cos") manny:run_chore(msb_msb_sheet_hold_sheet, "msb_msb_sheet.cos") meche.holding_sheet = FALSE inventory_disabled = TRUE ly.ready_to_seduce = FALSE single_start_script(ly.meche_idles) end ly.talk_toga_with_charlie = function(arg1) -- line 1101 START_CUT_SCENE() stop_script(ly.charlie_idles) manny:walkto_object(ly.charlie_obj) if ly.meche_talk_count < 3 then manny:say_line("/lyma047/") charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") if find_script(ly.seduce_charlie) then while ly.ready_to_seduce do break_here() end end manny:wait_for_message() charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:push_costume("cc_taplook.cos") charlie:run_chore(cc_taplook_turn2mn, "cc_taplook.cos") charlie:say_line("/lycc048/") charlie:run_chore(cc_taplook_turn2slots, "cc_taplook.cos") else manny:say_line("/lyma049/") charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") if find_script(ly.seduce_charlie) then while ly.ready_to_seduce do break_here() end end manny:wait_for_message() charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:push_costume("cc_taplook.cos") charlie:run_chore(cc_taplook_turn2mn, "cc_taplook.cos") charlie:say_line("/lycc050/") charlie:wait_for_message() charlie:play_chore(cc_taplook_turn2slots, "cc_taplook.cos") charlie:say_line("/lycc051/") charlie:wait_for_chore(cc_taplook_turn2slots, "cc_taplook.cos") end if not find_script(charlies_slot.stop) then charlies_slot:stop() else wait_for_script(charlies_slot.stop) end charlie:stop_chore(cc_taplook_turn2slots, "cc_taplook.cos") charlie:pop_costume() start_script(ly.charlie_idles, ly) END_CUT_SCENE() end ly.throw_sheet = function(arg1) -- line 1149 START_CUT_SCENE() stop_script(ly.charlie_idles) charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") stop_script(charlies_slot.stop) stop_sound("ly_wheel.IMU") stop_script(slot_wheel.spin) if not ly.sheet_on_floor.has_object_states then ly:add_object_state(ly_sltha, "ly_cc_sheet.bm", "ly_cc_sheet.zbm", OBJSTATE_STATE, TRUE) ly.sheet_on_floor:set_object_state("ly_cc_sheet.cos") ly.sheet_on_floor.interest_actor:put_in_set(ly) end ly.sheet:free() ly.charlie_on_floor = TRUE ly.charlie_obj:make_untouchable() box_off("charlie_box") box_off("mannys_slot") manny.is_holding = nil manny:stop_chore(msb_msb_sheet_hold_sheet, "msb_msb_sheet.cos") inventory_disabled = FALSE manny:pop_costume() manny:setpos(1.50568, -0.210109, 0) manny:setrot(0, 176.891, 0) charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:set_visibility(FALSE) ly.sheet_on_floor:play_chore(ly_cc_sheet_here) stop_sound("um_roll.IMU") StartFullscreenMovie("ly_sheet_toss.snm") sleep_for(500) start_sfx("cc_shtts.WAV") ly.slot_handle[4]:set_visibility(TRUE) sleep_for(1000) if not ly.sheeted then ly.sheeted = TRUE charlie:say_line("/lycc052/") else charlie:say_line("/lycc053/") end sleep_for(4600) start_sfx("ccsheet1.wav") sleep_for(1250) start_sfx("cc_falls.wav") charlie:wait_for_message() charlie:say_line("/lycc054/") charlie:wait_for_message() ly.sheet_on_floor:play_chore(ly_cc_sheet_protest) wait_for_movie() if not unicycle_man.in_machine then if not unicycle_man.rolling then elseif not sound_playing("um_roll.IMU") then unicycle_man:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end end start_script(ly.charlie_struggle) start_script(ly.charlie_get_up_timer) END_CUT_SCENE() end ly.charlie_struggle = function(arg1) -- line 1226 local local1 local local2 = { "/lycc055/", "/lycc056/", "/lycc057/", "/lycc058/", "/lycc059/", "/lycc060/", "/lycc061/", "/lycc062/", "/lycc063/" } while TRUE do sleep_for(2000) ly.sheet_on_floor:play_chore(ly_cc_sheet_protest) local1 = pick_one_of({ "ccsheet1.wav", "ccsheet2.wav", "ccsheet3.wav", "ccsheet4.wav", "ccsheet5.wav", "ccsheet6.wav" }) start_sfx(local1, IM_HIGH_PRIORITY, 100) charlie:say_line(pick_one_of(local2, TRUE), { background = TRUE, skip_log = TRUE, volume = 80 }) charlie:wait_for_message() end end ly.charlie_get_up_timer = function(arg1) -- line 1248 sleep_for(25000) stop_script(ly.charlie_struggle) while cutSceneLevel > 0 do break_here() end START_CUT_SCENE() ly.charlie_on_floor = FALSE ly.charlie_obj:make_touchable() box_on("charlie_box") box_on("mannys_slot") stop_sound("um_roll.IMU") StartFullscreenMovie("ly_getup.snm") charlie:set_visibility(TRUE) ly.slot_handle[4]:set_visibility(FALSE) stop_script(ly.meche_idles) charlie:push_costume("cc_seduction.cos") charlie:play_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") meche:stop_chore(nil, "meche_ruba.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche.holding_sheet = TRUE sleep_for(2000) start_sfx("ccsheet1.wav") sleep_for(2500) start_sfx("cc_shtof.WAV") charlie:say_line("/lycc064/", { volume = 90 }) wait_for_movie() ly.sheet_on_floor.interest_actor:put_in_set(ly) ly.sheet_on_floor.interest_actor:stop_chore() ly.sheet_on_floor:complete_chore(ly_cc_sheet_gone) ForceRefresh() if not unicycle_man.in_machine then if not unicycle_man.rolling then elseif not sound_playing("um_roll.IMU") then unicycle_man:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end end charlie:wait_for_message() charlie:say_line("/lycc065/") charlie:wait_for_message() charlie:wait_for_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") charlie:pop_costume() END_CUT_SCENE() start_script(ly.charlie_idles, ly) start_script(ly.meche_idles, ly) end ly.charlies_jackpot = function(arg1) -- line 1310 local local1 local local2 local local3, local4 stop_script(ly.charlie_get_up_timer) stop_script(ly.charlie_idles) stop_script(ly.meche_idles) START_CUT_SCENE() start_script(ly.unicycle_stop_idles, ly) if not find_script(charlies_slot.stop) then start_script(charlies_slot.stop, charlies_slot, FALSE) end ly:add_object_state(ly_chaws, "ly_slot_door.bm", "ly_slot_door.zbm", OBJSTATE_STATE) ly.charlie_obj:set_object_state("ly_slot_door.cos") ly.charlie_obj.interest_actor:set_visibility(TRUE) ly.charlie_obj.interest_actor:put_in_set(ly) manny:walkto(0.60399699, -0.122419, 0, 0, 324.94, 0) manny:say_line("/lyma082/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() local1 = GetActorYawToPoint(manny.hActor, unicycle_man.point["charlie"].pos) manny:setrot(0, local1, 0, TRUE) manny:point_gesture() manny:say_line("/lyma083/") manny:wait_for_message() start_script(unicycle_man.cycle_straight_to, unicycle_man, unicycle_man.point["charlie"].pos, unicycle_man.point["charlie"].rot) unicycle_man:say_line("/lyum084/") unicycle_man:wait_for_message() wait_for_script(unicycle_man.cycle_straight_to) unicycle_man:wait_for_actor() unicycle_man:setpos(1.90781, -0.36290601, 0) unicycle_man:setrot(0, 270, 0) ly:current_setup(ly_chaws) meche:set_visibility(FALSE) unicycle_man:set_chore_looping(unicycle_man_idles, FALSE) unicycle_man:wait_for_chore(unicycle_man_idles) unicycle_man:play_chore(unicycle_man_crawl_slot) stop_sound("um_roll.IMU") sleep_for(3500) ly.charlie_obj:run_chore(ly_slot_door_open) sleep_for(3300) unicycle_man:play_chore(unicycle_man_hide_body) unicycle_man:wait_for_chore(unicycle_man_crawl_slot) start_script(ly.unicycle_slot_sfx) ly.charlie_obj:run_chore(ly_slot_door_close) sleep_for(1000) charlies_slot:scramble_to_win() local3 = Actor:create(nil, nil, nil, "Money") local3:set_costume("coin_pile.cos") local3:put_in_set(ly) local3:setpos(1.99385, -0.48749301, 0.16) local3:setrot(0, 0, 0) local4 = 0.1 start_sfx("ly_pyoff.IMU") while local4 <= 1 do SetActorScale(local3.hActor, local4) break_here() local4 = local4 + 0.050000001 end fade_sfx("ly_pyoff.IMU", 1000) sleep_for(2500) ly.charlie_obj:run_chore(ly_slot_door_open) unicycle_man:play_chore(unicycle_man_out_slot_no_grab) sleep_for(500) unicycle_man:play_chore(unicycle_man_show_body) sleep_for(4000) ly.charlie_obj:play_chore(ly_slot_door_close) unicycle_man:wait_for_chore(unicycle_man_out_slot_no_grab) ly:current_setup(ly_sltha) meche:set_visibility(TRUE) start_script(unicycle_man.cycle_straight_to, unicycle_man, unicycle_man.point[0].pos, unicycle_man.point[0].rot) sleep_for(3000) stop_script(ly.charlie_struggle) ly.sheet_on_floor.interest_actor:put_in_set(ly) ly.sheet_on_floor.interest_actor:stop_chore() stop_script(unicycle_man.cycle_straight_to) stop_sound("um_roll.IMU") StartFullscreenMovie("ly_win.snm") sleep_for(3000) start_sfx("cc_shtof.WAV") wait_for_movie() ly:current_setup(ly_sltha) unicycle_man:setpos(unicycle_man.point[0].pos.x, unicycle_man.point[0].pos.y, unicycle_man.point[0].pos.z) unicycle_man:setrot(unicycle_man.point[0].rot.x, unicycle_man.point[0].rot.y, unicycle_man.point[0].rot.z) unicycle_man:stop_chore(unicycle_man_roll) unicycle_man:play_chore_looping(unicycle_man_idles) charlie:stop_chore(nil, "cc_play_slot.cos") charlie:play_chore(cc_play_slot_hide_handle, "cc_play_slot.cos") charlie:push_costume("cc_seduction.cos") charlie:setpos(1.49489, -0.50857699, -0.119) charlie:setrot(0, 260, 0) charlie:set_visibility(TRUE) meche:setpos(1.44189, -0.845577, 0) meche:setrot(0, 330, 0) meche:stop_chore(nil, "meche_ruba.cos") meche:stop_chore(nil, "meche_seduction.cos") meche:stop_chore(nil, "mi_msb_sheet.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche:set_visibility(TRUE) charlie:play_chore(cc_seduction_take_money, "cc_seduction.cos") ly.sheet_on_floor.interest_actor:stop_chore() ly.sheet_on_floor:complete_chore(ly_cc_sheet_gone) ForceRefresh() charlie:say_line("/lycc085/") sleep_for(3200) while local4 >= 0.1 and charlie:is_speaking() do local4 = local4 - 0.1 SetActorScale(local3.hActor, local4) break_here() end charlie:wait_for_message() meche:say_line("/lymc086/") while local4 >= 0.1 and charlie:is_speaking() do local4 = local4 - 0.1 SetActorScale(local3.hActor, local4) break_here() end local3:free() local3 = nil charlie:wait_for_chore(cc_seduction_take_money, "cc_seduction.cos") box_on("charlie_box") box_on("mannys_slot") box_on("meche_box") music_state:set_sequence(seqChowchillaBye) IrisDown(450, 320, 1000) sleep_for(1500) ly:current_setup(ly_lavha) unicycle_man:free() stop_sound("um_roll.IMU") manny:setpos(2.22596, 3.59653, 0.89999998) manny:setrot(0, 102.462, 0) manny:set_collision_mode(COLLISION_OFF) meche:set_costume(nil) meche:set_costume("meche_ruba.cos") meche:set_mumble_chore(meche_ruba_mumble) meche:set_talk_chore(1, meche_ruba_stop_talk) meche:set_talk_chore(2, meche_ruba_a) meche:set_talk_chore(3, meche_ruba_c) meche:set_talk_chore(4, meche_ruba_e) meche:set_talk_chore(5, meche_ruba_f) meche:set_talk_chore(6, meche_ruba_l) meche:set_talk_chore(7, meche_ruba_m) meche:set_talk_chore(8, meche_ruba_o) meche:set_talk_chore(9, meche_ruba_t) meche:set_talk_chore(10, meche_ruba_u) meche:push_costume("mi_with_cc_toga.cos") meche:set_collision_mode(COLLISION_OFF) meche:setpos(2.03021, 3.5079, 0.90061998) meche:setrot(0, 306.86899, 0) meche:play_chore(meche_ruba_xarm_hold, "meche_ruba.cos") charlie:set_costume(nil) charlie:set_costume("cc_toga.cos") charlie:set_mumble_chore(cc_toga_mumble) charlie:set_talk_chore(1, cc_toga_stop_talk) charlie:set_talk_chore(2, cc_toga_a) charlie:set_talk_chore(3, cc_toga_c) charlie:set_talk_chore(4, cc_toga_e) charlie:set_talk_chore(5, cc_toga_f) charlie:set_talk_chore(6, cc_toga_l) charlie:set_talk_chore(7, cc_toga_m) charlie:set_talk_chore(8, cc_toga_o) charlie:set_talk_chore(9, cc_toga_t) charlie:set_talk_chore(10, cc_toga_u) charlie:set_collision_mode(COLLISION_OFF) charlie:set_walk_chore(cc_toga_walk) charlie:set_walk_rate(0.25) charlie:set_head(7, 8, 9, 120, 80, 80) charlie:set_look_rate(100) ly.mens_room:open() charlie:setpos(1.89022, 4.5444798, 0.89999998) charlie:setrot(0, 180.181, 0) charlie:follow_boxes() charlie.footsteps = footsteps.marble if not ly.mens_room.has_object_states then ly:add_object_state(ly_lavha, "ly_bath.bm", "ly_bath.zbm", OBJSTATE_STATE) ly.mens_room:set_object_state("ly_bath_door.cos") end IrisUp(125, 325, 1000) sleep_for(500) manny:head_look_at(nil) meche:head_look_at(nil) manny:head_forward_gesture() manny:say_line("/lyma087/") manny:wait_for_message() manny:twist_head_gesture() manny:say_line("/lyma088/") manny:wait_for_message() meche:play_chore(meche_ruba_drop_hands, "meche_ruba.cos") meche:say_line("/lymc089/") meche:wait_for_message() meche:wait_for_chore(meche_ruba_drop_hands, "meche_ruba.cos") ly.mens_room:play_chore(0) start_sfx("ly_batho.WAV") manny:head_look_at_point(1.94195, 3.9626, 1.302) charlie:walkto(1.95579, 3.78863, 0.89999998) sleep_for(500) start_script(manny.backup, manny, 1000) while charlie:is_moving() do if not charlie:find_sector_name("bath_psg") then charlie.footsteps = footsteps.rug end break_here() end charlie.footsteps = footsteps.rug ly.mens_room:play_chore(1) start_sfx("ly_bathc.WAV") ly.mens_room:close() charlie:say_line("/lycc090/", { x = 160, y = 30 }) meche:stop_chore(meche_ruba_xarm_hold, "meche_ruba.cos") meche:stop_chore(meche_ruba_drop_hands, "meche_ruba.cos") mi_with_cc_done_turning = FALSE meche:play_chore(mi_with_cc_toga_to_cc_toga, "mi_with_cc_toga.cos") sleep_for(1000) charlie:head_look_at(meche) sleep_for(2400) charlie:head_look_at(nil) charlie:setrot(0, 100, 0, TRUE) charlie:fade_in_chore(cc_toga_take_meche, "cc_toga.cos", 500) charlie:wait_for_chore(cc_toga_take_meche, "cc_toga.cos") charlie:play_chore(cc_toga_hold_meche, "cc_toga.cos") while mi_with_cc_done_turning < 1 do break_here() end while meche:is_choring(mi_with_cc_toga_to_cc_toga, FALSE, "mi_with_cc_toga.cos") do WalkActorForward(charlie.hActor) break_here() end meche:wait_for_chore(mi_with_cc_toga_to_cc_toga, "mi_with_cc_toga.cos") manny:head_look_at(nil) END_CUT_SCENE() ly.charlie_on_floor = FALSE ly.sheet_on_floor:make_untouchable() ly.charlie_obj:make_untouchable() ly.meche_obj:make_untouchable() ly.unicycle_man:make_untouchable() ly.charlie_gone = TRUE music_state:update() cur_puzzle_state[56] = TRUE charlie:free() meche:free() end ly.charlie_idles = function(arg1) -- line 1596 while system.currentSet == ly do ly.ready_to_seduce = FALSE charlie:play_chore(cc_play_slot_play_slots, "cc_play_slot.cos") sleep_for(1000) charlies_slot:spin() charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlies_slot:stop(FALSE) if find_script(ly.seduce_charlie) then ly.ready_to_seduce = TRUE while ly.ready_to_seduce do break_here() end end break_here() end end ly.meche_idles = function(arg1) -- line 1614 local local1 = FALSE while system.currentSet == ly do if meche.holding_sheet then if rnd(8) and not find_script(ly.seduce_charlie) then if cutSceneLevel <= 0 then start_script(ly.seduce_charlie, ly) wait_for_script(ly.seduce_charlie) end end elseif rnd(5) then if local1 then meche:run_chore(meche_ruba_drop_hands, "meche_ruba.cos") local1 = FALSE sleep_for(rndint(1000, 5000)) else meche:run_chore(meche_ruba_xarms, "meche_ruba.cos") local1 = TRUE sleep_for(rndint(5000, 10000)) end end break_here() end end ly.seduce_charlie = function(arg1) -- line 1642 while not ly.ready_to_seduce do break_here() end ly.meche_obj:make_untouchable() charlie:set_collision_mode(COLLISION_SPHERE, 0.8) meche:play_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") sleep_for(1000) charlie:push_costume("cc_seduction.cos") charlie:fade_in_chore(cc_seduction_sed_by_mec, "cc_seduction.cos", 500) sleep_for(6000) ly.meche_obj:make_touchable() charlie:set_collision_mode(COLLISION_OFF) charlie:wait_for_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") charlie:pop_costume() ly.ready_to_seduce = FALSE meche:wait_for_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:stop_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") end ly.set_up_actors = function(arg1) -- line 1665 ly.keno_actor:default() ly.slot_handle:init() charlies_slot:default() mannys_slot:default() mannys_slot:freeze() brennis:put_in_set(ly) brennis:default() brennis:push_costume("br_idles.cos") brennis:setpos(-0.0427321, 4.02445, 0.9) brennis:setrot(0, -2343.65, 0) ly:brennis_start_idle() if not ly.charlie_gone then charlie:set_costume(nil) charlie:set_costume("ccharlie.cos") charlie:set_mumble_chore(ccharlie_mumble) charlie:set_talk_chore(1, ccharlie_no_talk) charlie:set_talk_chore(2, ccharlie_a) charlie:set_talk_chore(3, ccharlie_c) charlie:set_talk_chore(4, ccharlie_e) charlie:set_talk_chore(5, ccharlie_f) charlie:set_talk_chore(6, ccharlie_l) charlie:set_talk_chore(7, ccharlie_m) charlie:set_talk_chore(8, ccharlie_o) charlie:set_talk_chore(9, ccharlie_t) charlie:set_talk_chore(10, ccharlie_u) charlie:push_costume("cc_play_slot.cos") charlie:put_in_set(ly) charlie:ignore_boxes() charlie:setpos(1.83869, -0.508564, 0.014) charlie:setrot(0, 260, 0) start_script(ly.charlie_idles, ly) meche:set_costume(nil) meche:set_costume("meche_ruba.cos") meche:set_mumble_chore(meche_ruba_mumble) meche:set_talk_chore(1, meche_ruba_stop_talk) meche:set_talk_chore(2, meche_ruba_a) meche:set_talk_chore(3, meche_ruba_c) meche:set_talk_chore(4, meche_ruba_e) meche:set_talk_chore(5, meche_ruba_f) meche:set_talk_chore(6, meche_ruba_l) meche:set_talk_chore(7, meche_ruba_m) meche:set_talk_chore(8, meche_ruba_o) meche:set_talk_chore(9, meche_ruba_t) meche:set_talk_chore(10, meche_ruba_u) meche:put_in_set(ly) meche:ignore_boxes() meche:setpos(1.4388, -0.679984, 0) meche:setrot(0, 313.314, 0) meche:push_costume("meche_seduction.cos") meche:push_costume("mi_msb_sheet.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche.holding_sheet = TRUE start_script(ly.meche_idles, ly) unicycle_man:default() unicycle_man:put_in_set(ly) unicycle_man:restore_pos() start_script(ly.unicycle_idles, ly) else charlie:free() meche:free() unicycle_man:free() end end ly.set_up_object_states = function(arg1) -- line 1737 ly:add_object_state(ly_kenla, "ly_keno_1.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_2.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_3.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_4.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_5.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_6.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_7.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_8.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_9.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_10.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_11.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_12.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_13.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_14.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_15.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_16.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_17.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_18.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_19.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_20.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_21.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_22.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_23.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_24.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_25.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_26.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_27.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_28.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_29.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_30.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_31.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_32.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_4.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_5.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_6.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_7.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_8.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_9.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_10.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_11.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_12.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_13.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_14.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_15.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_16.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_17.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_18.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_19.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_20.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_21.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_22.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_23.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_24.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_25.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_26.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_27.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_28.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_29.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_30.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_31.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_32.bm", nil, OBJSTATE_UNDERLAY) end ly.cameraman = function(arg1) -- line 1804 local local1, local2 local local3 cameraman_watching_set = arg1 if cameraman_disabled == FALSE and arg1:current_setup() ~= arg1.setups.overhead and cutSceneLevel <= 0 then local1, cameraman_box_name, local2 = system.currentActor:find_sector_type(CAMERA) if cameraman_box_name then local3 = getglobal(cameraman_box_name) if local3 ~= nil and ly:current_setup() ~= local3 then ly:current_setup(local3) end elseif ly:current_setup() ~= "ly_intha" then ly:current_setup(ly_intha) end end end ly.manny_collisions = function(arg1) -- line 1826 while system.currentSet == ly do if manny:find_sector_name("slot_box") or manny:find_sector_name("mannys_slot") or manny:find_sector_name("charlie_box") or manny:find_sector_name("meche_box") then manny:set_collision_mode(COLLISION_SPHERE, 0.35) else manny:set_collision_mode(COLLISION_OFF) end break_here() end end ly.update_music_state = function(arg1) -- line 1843 if ly.charlie_gone then return stateLY_BREN else return stateLY end end ly.enter = function(arg1) -- line 1852 ly:set_up_object_states() ly:set_up_actors() start_script(ly.gun_control) start_script(ly.keno_actor.game, ly.keno_actor) start_script(ly.manny_collisions, ly) ly:add_ambient_sfx({ "lyAmb1.wav", "lyAmb2.wav", "lyAmb3.wav", "lyAmb4.wav" }, { min_volume = 40, max_volume = 127, min_delay = 6000, max_delay = 10000 }) SetShadowColor(10, 10, 10) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 0, -4, 4) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") end ly.exit = function(arg1) -- line 1872 stop_script(ly.manny_collisions) manny:set_collision_mode(COLLISION_OFF) stop_script(slot_wheel.spin) stop_script(ly.unicycle_idles) stop_script(ly.unicycle_slot_sfx) stop_script(ly.keno_actor.game) ly.keno_actor:free() charlies_slot:free() mannys_slot:free() stop_script(ly.charlie_idles) charlie:free() meche:free() if brennis.ly_idle_script then stop_script(brennis.ly_idle_script) brennis.ly_idle_script = nil end brennis:free() unicycle_man:save_pos() unicycle_man:free() stop_script(ly.gun_control) stop_script(ly.charlie_struggle) stop_script(ly.charlie_get_up_timer) ly.sheet_on_floor.interest_actor:set_costume(nil) ly.sheet_on_floor.has_object_states = FALSE ly.mens_room.interest_actor:set_costume(nil) ly.mens_room.has_object_states = FALSE ly.service_door.interest_actor:set_costume(nil) ly.service_door.has_object_states = FALSE stop_sound("um_roll.IMU") stop_sound("ly_pyoff.IMU") stop_sound("ly_wheel.IMU") KillActorShadows(manny.hActor) end ly.sheet = Object:create(ly, "/lytx091/sheet", 0, 0, 0, { range = 0 }) ly.sheet.use = function(arg1) -- line 1928 manny:say_line("/lyma092/") end ly.sheet.lookAt = function(arg1) -- line 1932 manny:say_line("/lyma093/") end ly.sheet.default_response = ly.sheet.use ly.brennis_obj = Object:create(ly, "/lytx094/elevator demon", -0.048044398, 3.9284, 1.51, { range = 0.80000001 }) ly.brennis_obj.use_pnt_x = -0.12957799 ly.brennis_obj.use_pnt_y = 3.47597 ly.brennis_obj.use_pnt_z = 0.89999998 ly.brennis_obj.use_rot_x = 0 ly.brennis_obj.use_rot_y = 349.754 ly.brennis_obj.use_rot_z = 0 ly.brennis_obj.person = TRUE ly.brennis_obj.demon = TRUE ly.brennis_obj.lookAt = function(arg1) -- line 1951 manny:say_line("/lyma095/") end ly.brennis_obj.pickUp = function(arg1) -- line 1955 system.default_response("right") end ly.brennis_obj.use = function(arg1) -- line 1959 if not manny.fancy then if manny:walkto_object(arg1) then start_script(ly.talk_clothes_with_brennis) end elseif fi.gun.owner ~= manny then manny:turn_left(180) manny:say_line("/lyma096/") else Dialog:run("br2", "dlg_brennis2.lua") end end ly.brennis_obj.use_sheet = function(arg1) -- line 1974 START_CUT_SCENE() manny:say_line("/lyma097/") wait_for_message() brennis:say_line("/lybs098/") END_CUT_SCENE() end ly.statue = Object:create(ly, "/lytx099/statue", 3.34677, -2.6134701, 2.5899999, { range = 1.6 }) ly.statue.use_pnt_x = 3.34677 ly.statue.use_pnt_y = -1.78347 ly.statue.use_pnt_z = 0.44999999 ly.statue.use_rot_x = 0 ly.statue.use_rot_y = 922.95398 ly.statue.use_rot_z = 0 ly.statue.lookAt = function(arg1) -- line 1992 manny:say_line("/lyma100/") end ly.statue.pickUp = function(arg1) -- line 1996 system.default_response("right") end ly.statue.use = function(arg1) -- line 2000 manny:say_line("/lyma101/") end ly.statue.use_sheet = function(arg1) -- line 2004 manny:say_line("/lyma102/") end ly.charlie_obj = Object:create(ly, "/lytx103/Chowchilla Charlie", 1.82118, -0.51648003, 0.37200001, { range = 0.60000002 }) ly.charlie_obj.use_pnt_x = 1.61446 ly.charlie_obj.use_pnt_y = -0.26686499 ly.charlie_obj.use_pnt_z = 0 ly.charlie_obj.use_rot_x = 0 ly.charlie_obj.use_rot_y = 220.021 ly.charlie_obj.use_rot_z = 0 ly.charlie_obj.person = TRUE ly.charlie_obj.lookAt = function(arg1) -- line 2019 if not arg1.seen then START_CUT_SCENE() arg1.seen = TRUE manny:say_line("/lyma104/") manny:wait_for_message() manny:say_line("/lyma105/") END_CUT_SCENE() else manny:say_line("/lyma106/") end end ly.charlie_obj.pickUp = function(arg1) -- line 2032 manny:say_line("/lyma107/") end ly.charlie_obj.use = function(arg1) -- line 2036 start_script(ly.talk_toga_with_charlie) end ly.charlie_obj.use_sheet = function(arg1) -- line 2040 start_script(ly.throw_sheet) end ly.meche_obj = Object:create(ly, "/lytx108/Meche", 1.52403, -0.63770503, 0.47499999, { range = 0.80000001 }) ly.meche_obj.use_pnt_x = 1.65277 ly.meche_obj.use_pnt_y = -0.32719201 ly.meche_obj.use_pnt_z = 0 ly.meche_obj.use_rot_x = 0 ly.meche_obj.use_rot_y = 153.737 ly.meche_obj.use_rot_z = 0 ly.meche_obj.person = TRUE ly.meche_obj.lookAt = function(arg1) -- line 2055 manny:say_line("/lyma109/") end ly.meche_obj.pickUp = function(arg1) -- line 2059 system.default_response("not now") end ly.meche_obj.use = function(arg1) -- line 2063 start_script(ly.talk_clothes_with_meche) end ly.meche_obj.use_sheet = function(arg1) -- line 2067 if ly.meche_talk_count < 4 then arg1:use() else manny:say_line("/lyma110/") manny:wait_for_message() meche:say_line("/lymc111/") end end ly.slot1 = Object:create(ly, "/lytx112/slot machine", 1.98998, -0.113677, 0.47, { range = 0.60000002 }) ly.slot1.use_pnt_x = 1.63983 ly.slot1.use_pnt_y = -0.272295 ly.slot1.use_pnt_z = 0 ly.slot1.use_rot_x = 0 ly.slot1.use_rot_y = 280.24301 ly.slot1.use_rot_z = 0 ly.slot1.lookAt = function(arg1) -- line 2087 manny:say_line("/lyma113/") end ly.slot1.pickUp = function(arg1) -- line 2091 system.default_response("portable") end ly.slot1.use = function(arg1) -- line 2095 if manny:find_sector_name("mannys_slot") then start_script(ly.playslots, ly, arg1) elseif manny:walkto_object(arg1) then start_script(ly.playslots, ly, arg1) end end ly.slot1.use_sheet = function(arg1) -- line 2103 manny:say_line("/lyma114/") end ly.sheet_on_floor = Object:create(ly, "/lytx115/sheet", 1.7376, -0.488377, 0, { range = 0.60000002 }) ly.sheet_on_floor.use_pnt_x = 1.5376 ly.sheet_on_floor.use_pnt_y = -0.62837702 ly.sheet_on_floor.use_pnt_z = 0 ly.sheet_on_floor.use_rot_x = 0 ly.sheet_on_floor.use_rot_y = -33.944099 ly.sheet_on_floor.use_rot_z = 0 ly.sheet_on_floor:make_untouchable() ly.sheet_on_floor.lookAt = function(arg1) -- line 2118 manny:say_line("/lyma116/") end ly.sheet_on_floor.pickUp = function(arg1) -- line 2122 arg1:make_untouchable() ly.sheet:hold() end ly.sheet_on_floor.use = ly.sheet_on_floor.pickUp ly.unicycle_man = Object:create(ly, "/lytx117/gambler", 1.05716, 0.50252402, 0.40000001, { range = 0.80000001 }) ly.unicycle_man.use_pnt_x = 1.2671601 ly.unicycle_man.use_pnt_y = 0.25252399 ly.unicycle_man.use_pnt_z = 0 ly.unicycle_man.use_rot_x = 0 ly.unicycle_man.use_rot_y = 1495.33 ly.unicycle_man.use_rot_z = 0 ly.unicycle_man.person = TRUE ly.unicycle_man.lookAt = function(arg1) -- line 2140 if not ly.met_agent then manny:say_line("/lyma118/") else manny:say_line("/lyma119/") end end ly.unicycle_man.pickUp = function(arg1) -- line 2148 system.default_response("think") end ly.unicycle_man.use = function(arg1) -- line 2152 start_script(ly.talk_to_agent) end ly.mens_room = Object:create(ly, "/lytx120/door", 2.03262, 4.2983999, 1.39, { range = 0.5 }) ly.mens_room.use_pnt_x = 1.9454401 ly.mens_room.use_pnt_y = 3.98 ly.mens_room.use_pnt_z = 0.89999998 ly.mens_room.use_rot_x = 0 ly.mens_room.use_rot_y = 14.326 ly.mens_room.use_rot_z = 0 ly.mens_room.out_pnt_x = 1.76959 ly.mens_room.out_pnt_y = 4.6870298 ly.mens_room.out_pnt_z = 0.89999998 ly.mens_room.out_rot_x = 0 ly.mens_room.out_rot_y = 4.1866498 ly.mens_room.out_rot_z = 0 ly.mens_room.passage = { "bath_psg" } ly.mens_room.lookAt = function(arg1) -- line 2175 manny:say_line("/lyma121/") end ly.mens_room.walkOut = function(arg1) -- line 2179 START_CUT_SCENE() if manny.is_holding == ly.sheet then system.default_response("no") manny:walkto(1.96305, 3.77355, 0.9, 0, 184.876, 0) manny:wait_for_message() ly.sheet:use() elseif not manny.fancy then if not ly.mens_room.has_object_states then ly:add_object_state(ly_lavha, "ly_bath.bm", "ly_bath.zbm", OBJSTATE_STATE) ly.mens_room:set_object_state("ly_bath_door.cos") end if not ly.charlie_gone then if not ly.peed then ly.peed = TRUE arg1:open_door_and_enter() manny:say_line("/lyma122/") manny:wait_for_message() manny:say_line("/lyma123/") else manny:say_line("/lyma124/") end else manny.fancy = TRUE arg1:open_door_and_enter() manny:shrug_gesture() manny:say_line("/lyma125/") end else manny:say_line("/lyma126/") end END_CUT_SCENE() end ly.mens_room.open_door_and_enter = function(arg1) -- line 2216 manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z, arg1.use_rot_x, arg1.use_rot_y, arg1.use_rot_z) manny:play_chore(msb_hand_on_obj, manny.base_costume) sleep_for(200) arg1:play_chore(0) start_sfx("ly_batho.WAV") arg1:open() manny:wait_for_chore(msb_hand_on_obj, manny.base_costume) manny:stop_chore(msb_hand_on_obj, manny.base_costume) manny:play_chore(msb_hand_off_obj, manny.base_costume) manny:walkto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) manny:wait_for_actor() arg1:play_chore(1) start_sfx("ly_bathc.WAV") manny:wait_for_chore(msb_hand_off_obj, manny.base_costume) manny:stop_chore(msb_hand_off_obj, manny.base_costume) if manny.fancy then sleep_for(3000) manny:default("thunder") else sleep_for(4000) start_sfx("ly_urinl.WAV") end arg1:play_chore(0) start_sfx("ly_batho.WAV") arg1:wait_for_chore(0) manny:setrot(arg1.out_rot_x, arg1.out_rot_y + 180, arg1.out_rot_z) manny:walkto(1.96305, 3.77355, 0.9, 0, 184.876, 0) manny:wait_for_actor() arg1:play_chore(1) start_sfx("ly_bathc.WAV") arg1:close() end ly.service_door = Object:create(ly, "/lytx120/door", 2.5296299, 4.0496202, 1.339, { range = 0.5 }) ly.service_door.use_pnt_x = 2.5390899 ly.service_door.use_pnt_y = 3.6882501 ly.service_door.use_pnt_z = 0.89999998 ly.service_door.use_rot_x = 0 ly.service_door.use_rot_y = 358.625 ly.service_door.use_rot_z = 0 ly.service_door.out_pnt_x = 2.53511 ly.service_door.out_pnt_y = 4.48 ly.service_door.out_pnt_z = 0.89999998 ly.service_door.out_rot_x = 0 ly.service_door.out_rot_y = 359.58701 ly.service_door.out_rot_z = 0 ly.service_door.touchable = FALSE ly.service_door.passage = { "service_psg" } ly.service_door.walkOut = function(arg1) -- line 2271 START_CUT_SCENE() if manny.is_holding == ly.sheet then system.default_response("no") manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z, arg1.use_rot_x, arg1.use_rot_y + 180, arg1.use_rot_z) manny:wait_for_message() ly.sheet:use() else if not ly.service_door.has_object_states then ly:add_object_state(ly_lavha, "ly_service.bm", "ly_service.zbm", OBJSTATE_STATE) ly.service_door:set_object_state("ly_service_door.cos") end manny:walkto(2.56884, 3.85944, 0.9, 0, 16.9137, 0) manny:wait_for_actor() manny:play_chore(msb_reach_med, manny.base_costume) sleep_for(250) start_script(manny.backup, manny, 350) sleep_for(250) arg1:play_chore(0) arg1:wait_for_chore(0) arg1:open() manny:walkto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) sleep_for(1000) arg1:play_chore(1) arg1:close() end END_CUT_SCENE() if manny.is_holding ~= ly.sheet then te:come_out_door(te.ly_door) end end ly.service_door.comeOut = function(arg1) -- line 2304 START_CUT_SCENE() ly:switch_to_set() ly:current_setup(ly_lavha) if not ly.service_door.has_object_states then ly:add_object_state(ly_lavha, "ly_service.bm", "ly_service.zbm", OBJSTATE_STATE) ly.service_door:set_object_state("ly_service_door.cos") end arg1:open() manny:put_in_set(ly) manny:setpos(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) manny:setrot(arg1.out_rot_x, arg1.out_rot_y + 180, arg1.out_rot_z) if not manny.fancy then manny:play_chore(msb_hand_off_obj, manny.base_costume) else manny:play_chore(mcc_thunder_hand_off_obj, "mcc_thunder.cos") end arg1:play_chore(0) arg1:wait_for_chore(0) if not manny.fancy then manny:wait_for_chore(msb_hand_off_obj, manny.base_costume) manny:stop_chore(msb_hand_off_obj, manny.base_costume) else manny:wait_for_chore(mcc_thunder_hand_off_obj, manny.base_costume) manny:stop_chore(mcc_thunder_hand_off_obj, manny.base_costume) end manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z) manny:wait_for_actor() arg1:run_chore(1) arg1:close() END_CUT_SCENE() end ly.sh_door = Object:create(ly, "/lytx002/door", -0.098697402, -3.63239, 0.83999997, { range = 0.60000002 }) ly.sh_door.use_pnt_x = -0.098411702 ly.sh_door.use_pnt_y = -3.13359 ly.sh_door.use_pnt_z = 0.44999999 ly.sh_door.use_rot_x = 0 ly.sh_door.use_rot_y = 179.772 ly.sh_door.use_rot_z = 0 ly.sh_door.out_pnt_x = -0.097895198 ly.sh_door.out_pnt_y = -3.425 ly.sh_door.out_pnt_z = 0.44999999 ly.sh_door.out_rot_x = 0 ly.sh_door.out_rot_y = 179.772 ly.sh_door.out_rot_z = 0 ly.sh_door.touchable = FALSE ly.sh_box = ly.sh_door ly.sh_door.walkOut = function(arg1) -- line 2364 START_CUT_SCENE() ResetMarioControls() manny:say_line("/doma165/") manny:walkto(-0.100971, -3.23397, 0.45, 0, 6.21033, 0) END_CUT_SCENE() end CheckFirstTime("_actors.lua") system.actorCount = 0 system.actorTable = { } system.actorTemplate = { name = "<unnamed>", hActor = nil } Actor = system.actorTemplate Actor.is_holding = nil Actor.is_talking = nil Actor.walk_chore = nil Actor.default_look_rate = 200 Actor.last_chore = nil Actor.last_play_chore = nil CHORE_LOOP = TRUE CHORE_NOLOOP = FALSE MODE_BACKGROUND = TRUE MODE_NORMAL = FALSE Actor.hold_chore = nil Actor.MARKER_LEFT_WALK = 10 Actor.MARKER_RIGHT_WALK = 15 Actor.MARKER_LEFT_RUN = 20 Actor.MARKER_RIGHT_RUN = 25 Actor.MARKER_LEFT_TURN = 30 Actor.MARKER_RIGHT_TURN = 35 Actor.idles_allowed = TRUE Actor.last_chore_played = nil Actor.last_cos_played = nil Actor.base_costume = nil Actor.create = function(arg1, arg2, arg3, arg4, arg5) -- line 73 local local1 = { } local1.parent = arg1 if arg5 then local1.name = arg5 else local1.name = arg2 end local1.hActor = LoadActor(arg5) local1.footsteps = nil local1.saylineTable = { } system.actorTable[local1.name] = local1 system.actorCount = system.actorCount + 1 system.actorTable[local1.hActor] = local1 arg1.create_dialogStack(local1) return local1 end Actor.getpos = function(arg1) -- line 103 local local1 = { } local1.x, local1.y, local1.z = GetActorPos(arg1.hActor) return local1 end Actor.getrot = function(arg1) -- line 115 local local1 = { } local1.x, local1.y, local1.z = GetActorRot(arg1.hActor) return local1 end Actor.get_positive_rot = function(arg1) -- line 126 local local1 = { } local1.x, local1.y, local1.z = GetActorRot(arg1.hActor) while local1.y < 0 do local1.y = local1.y + 360 end while local1.y > 360 do local1.y = local1.y - 360 end while local1.x < 0 do local1.x = local1.x + 360 end while local1.x > 360 do local1.x = local1.z - 360 end while local1.z < 0 do local1.z = local1.z + 360 end while local1.z > 360 do local1.z = local1.z - 360 end return local1 end Actor.get_positive_yaw_to_point = function(arg1, arg2) -- line 160 local local1 = GetActorYawToPoint(arg1.hActor, { x = arg2.x, y = arg2.y, z = arg2.z }) while local1 < 0 do local1 = local1 + 360 end while local1 > 360 do local1 = local1 - 360 end return local1 end Actor.setpos = function(arg1, arg2, arg3, arg4) -- line 179 if type(arg2) == "table" then arg1:moveto(arg2.x, arg2.y, arg2.z) else arg1:moveto(arg2, arg3, arg4) end end Actor.set_softimage_pos = function(arg1, arg2, arg3, arg4) -- line 191 if type(arg2) == "table" then arg1:moveto(arg2.x / 10, -arg2.z / 10, arg2.y / 10) else arg1:moveto(arg2 / 10, -arg4 / 10, arg3 / 10) end end Actor.get_softimage_pos = function(arg1) -- line 204 local local1 = arg1:getpos() local1.y, local1.z = local1.z, -local1.y local1.x, local1.y, local1.z = local1.x * 10, local1.y * 10, local1.z * 10 return local1 end convert_softimage_pos = function(arg1, arg2, arg3) -- line 218 local local1 = arg1 / 10 local local2 = 0 - arg3 / 10 local local3 = arg2 / 10 return local1, local2, local3 end Actor.turn_toward_entity = function(arg1, arg2, arg3, arg4) -- line 232 if arg3 then while TurnActorTo(arg1.hActor, arg2, arg3, arg4) do break_here() end elseif arg2.use_pnt_x ~= nil then while TurnActorTo(arg1.hActor, arg2.use_pnt_x, arg2.use_pnt_y, arg2.use_pnt_z) do break_here() end else arg2, arg3, arg4 = arg2:getpos() while TurnActorTo(arg1.hActor, arg2, arg3, arg4) do break_here() end end end Actor.face_entity = function(arg1, arg2, arg3, arg4) -- line 260 local local1 local local2 if type(arg2) == "table" then if arg2.interest_actor then local1 = arg2.interest_actor:getpos() elseif arg2.getpos then local1 = arg2:getpos() elseif arg2.x then local1 = arg2 else PrintDebug("Actor:face_entity() -- invalid argument\n") end else local1 = { } local1.x = arg2 local1.y = arg3 local1.z = arg4 end if local1 then local2 = GetActorYawToPoint(arg1.hActor, local1) arg1:setrot(0, local2, 0, TRUE) end end Actor.set_colormap = function(arg1, arg2) -- line 292 SetActorColormap(arg1.hActor, arg2) end Actor.setrot = function(arg1, arg2, arg3, arg4, arg5) -- line 302 if type(arg2) == "table" then SetActorRot(arg1.hActor, arg2.x, arg2.y, arg2.z, arg3) else SetActorRot(arg1.hActor, arg2, arg3, arg4, arg5) end end Actor.walkto = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) -- line 319 arg1:set_run(FALSE) if arg1.set_walk_backwards then arg1:set_walk_backwards(FALSE) end if arg1 == system.currentActor then ResetMarioControls() end if type(arg2) == "table" then return arg1:walkto_object(arg2, arg3) else SetActorConstrain(arg1.hActor, FALSE) if arg1 == system.currentActor then WalkVector.x = 0 WalkVector.y = 0 WalkVector.z = 0 end WalkActorTo(arg1.hActor, arg2, arg3, arg4) if arg5 then while arg1:is_moving() do break_here() end arg1:setrot(arg5, arg6, arg7, TRUE) end end end Actor.runto = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 349 if arg1.set_walk_backwards then arg1:set_walk_backwards(FALSE) end if arg1 == system.currentActor then ResetMarioControls() end arg1:set_run(TRUE) if type(arg2) == "table" then arg1:walkto_object(arg2, arg3) else SetActorConstrain(arg1.hActor, FALSE) if arg1 == system.currentActor then WalkVector.x = 0 WalkVector.y = 0 WalkVector.z = 0 end WalkActorTo(arg1.hActor, arg2, arg3, arg4) if arg5 then while arg1:is_moving() do break_here() end arg1:setrot(arg5, arg6, arg7, TRUE) end end arg1:wait_for_actor() arg1:set_run(FALSE) end Actor.walk_and_face = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 386 arg1:walkto(arg2, arg3, arg4) while arg1:is_moving() do break_here() end arg1:setrot(arg5, arg6, arg7, TRUE) arg1:wait_for_actor() end Actor.walk_forward = function(arg1) -- line 400 WalkActorForward(arg1.hActor) end Actor.moveto = function(arg1, arg2, arg3, arg4) -- line 409 if type(arg2) == "table" then PutActorAt(arg1.hActor, arg2.use_pnt_x, arg2.use_pnt_y, arg2.use_pnt_z) else PutActorAt(arg1.hActor, arg2, arg3, arg4) end end Actor.scale = function(arg1, arg2) -- line 421 SetActorScale(arg1.hActor, arg2) end Actor.driveto = function(arg1, arg2, arg3, arg4) -- line 429 DriveActorTo(arg1.hActor, arg2, arg3, arg4) end Actor.set_run = function(arg1, arg2) -- line 433 end Actor.force_auto_run = function(arg1, arg2) -- line 437 end Actor.walkto_object = function(arg1, arg2, arg3) -- line 445 local local1, local2, local3, local4, local5, local6, local7 local local8, local9 arg1:set_run(FALSE) if arg1.set_walk_backwards then arg1:set_walk_backwards(FALSE) end if arg2.parent == Ladder then if arg3 then local9 = arg2.base.out_pnt_z local8 = arg2.top.out_pnt_z else local9 = arg2.base.use_pnt_z local8 = arg2.top.use_pnt_z end local1 = arg1:getpos() if abs(local9 - local1.z) < abs(local8 - local1.z) then arg2 = arg2.base else arg2 = arg2.top end end if arg3 then local2 = arg2.out_pnt_x local3 = arg2.out_pnt_y local4 = arg2.out_pnt_z local5 = arg2.out_rot_x local6 = arg2.out_rot_y local7 = arg2.out_rot_z else local2 = arg2.use_pnt_x local3 = arg2.use_pnt_y local4 = arg2.use_pnt_z local5 = arg2.use_rot_x local6 = arg2.use_rot_y local7 = arg2.use_rot_z end if local2 then PrintDebug("Walking " .. arg1.name .. " to " .. arg2.name .. "\t" .. local2 .. "\t" .. local3 .. "\t" .. local4 .. "\n") PrintDebug("IndexFB_disabled: " .. tostring(indexFB_disabled) .. "\n") if arg1 == system.currentActor then stop_movement_scripts() end SetActorConstrain(arg1.hActor, FALSE) arg1:walkto(local2, local3, local4, local5, local6, local7) while arg1:is_moving() or arg1:is_turning() do break_here() end if arg1 == system.currentActor and MarioControl then WalkVector.x = 0 WalkVector.y = 0 WalkVector.z = 0 single_start_script(WalkManny) end local1 = object_proximity(arg2, arg3) if local1 <= MAX_PROX then PrintDebug("made it to the use/out point of " .. arg2.name .. "!\n") return TRUE else PrintDebug("Didn't make it to the use/out point of " .. arg2.name .. "!\n") return FALSE end else PrintDebug("Object has no use/out point!\n") end end Actor.walk_closeto_object = function(arg1, arg2, arg3) -- line 527 local local1, local2, local3, local4, local5, local6, local7 local local8 = 0 arg1:set_run(FALSE) if arg1.set_walk_backwards then arg1:set_walk_backwards(FALSE) end local2 = arg2.use_pnt_x local3 = arg2.use_pnt_y local4 = arg2.use_pnt_z local5 = arg2.use_rot_x local6 = arg2.use_rot_y local7 = arg2.use_rot_z if local2 then PrintDebug("Walking " .. arg1.name .. " to " .. arg2.name .. "\t" .. local2 .. "\t" .. local3 .. "\t" .. local4 .. " within " .. arg3 .. "\n") if arg1 == system.currentActor then stop_movement_scripts() end SetActorConstrain(arg1.hActor, FALSE) arg1:walkto(local2, local3, local4, local5, local6, local7) while arg1:is_moving() or arg1:is_turning() and local8 < 20000 do break_here() local8 = local8 + system.frameTime end if arg1 == system.currentActor and MarioControl then WalkVector.x = 0 WalkVector.y = 0 WalkVector.z = 0 single_start_script(WalkManny) end local1 = proximity(manny.hActor, local2, local3, local4) if local1 <= arg3 then PrintDebug("made it close to the use point of " .. arg2.name .. "!\n") return TRUE else PrintDebug("Didn't make it to the use point of " .. arg2.name .. ", proximity = " .. local1 .. "!\n") return FALSE end else PrintDebug("Object has no use/out point!\n") end end COLLISION_OFF = 0 COLLISION_BOX = 1 COLLISION_SPHERE = 2 Actor.set_collision_mode = function(arg1, arg2, arg3) -- line 585 SetActorCollisionMode(arg1.hActor, arg2) if arg3 ~= nil and arg2 ~= COLLISION_OFF then SetActorCollisionScale(arg1.hActor, arg3) end end Actor.set_time_scale = function(arg1, arg2) -- line 592 SetActorTimeScale(arg1.hActor, arg2) end Actor.offsetBy = function(arg1, arg2, arg3, arg4) -- line 601 local local1 local1 = arg1:getpos() if arg2 then local1.x = local1.x + arg2 end if arg3 then local1.y = local1.y + arg3 end if arg4 then local1.z = local1.z + arg4 end arg1:setpos(local1.x, local1.y, local1.z) end Actor.turn_right = function(arg1, arg2) -- line 617 local local1 = arg1:getrot() arg1:setrot(local1.x, local1.y - arg2, local1.z, TRUE) end Actor.turn_left = function(arg1, arg2) -- line 622 local local1 = arg1:getrot() arg1:setrot(local1.x, local1.y + arg2, local1.z, TRUE) end Actor.teleport_out_of_hot_box = function(arg1) -- line 636 local local1, local2, local3 local local4 = { } local local5, local6 local1, local2, local3 = arg1:find_sector_type(HOT) if local1 then if arg1.is_backward then local6 = arg1:getrot() arg1:setrot(local6.x, local6.y + 180, local6.z) end local4.x, local4.y, local4.z = GetSectorOppositeEdge(arg1.hActor, local2) if local4.x then arg1:setpos(local4.x, local4.y, local4.z) system.currentSet:force_camerachange() end if arg1.is_backward then arg1:setrot(local6.x, local6.y, local6.z) end end end Actor.play_chore = function(arg1, arg2, arg3) -- line 662 if arg1:get_costume() and arg2 ~= nil then arg1.last_chore_played = arg2 arg1.last_cos_played = arg3 PlayActorChore(arg1.hActor, arg2, arg3) elseif arg2 == nil then PrintDebug("(" .. tostring(arg1.name) .. ") Actor:play_chore() trying to play nil chore.\n") end end Actor.fade_in_chore = function(arg1, arg2, arg3, arg4) -- line 678 FadeInChore(arg1.hActor, arg3, arg2, arg4) end Actor.fade_out_chore = function(arg1, arg2, arg3, arg4) -- line 686 FadeOutChore(arg1.hActor, arg3, arg2, arg4) end Actor.blend = function(arg1, arg2, arg3, arg4, arg5, arg6) -- line 695 if not arg5 then arg5 = arg1:get_costume() end if not arg6 then arg6 = arg5 end start_script(arg1.fade_in_chore, arg1, arg2, arg5, arg4) if arg3 ~= nil then start_script(arg1.fade_out_chore, arg1, arg3, arg6, arg4) end sleep_for(arg4) end Actor.loop_chore_for = function(arg1, arg2, arg3, arg4, arg5) -- line 715 arg1:play_chore_looping(arg2, arg3) sleep_for(rndint(arg4, arg5)) arg1:set_chore_looping(arg2, FALSE, arg3) arg1:wait_for_chore(arg2, arg3) arg1:stop_chore(arg2, arg3) end Actor.run_chore = function(arg1, arg2, arg3) -- line 727 arg1:play_chore(arg2, arg3) arg1:wait_for_chore(arg2, arg3) end Actor.play_chore_looping = function(arg1, arg2, arg3) -- line 736 if arg1:get_costume() and arg2 ~= nil then PlayActorChoreLooping(arg1.hActor, arg2, arg3) elseif arg2 == nil then PrintDebug("Actor:play_chore_looping() trying to play nil chore.\n") end end Actor.stop_chore = function(arg1, arg2, arg3) -- line 749 if arg1:get_costume() then StopActorChore(arg1.hActor, arg2, arg3) end end Actor.stop_looping_chore = function(arg1, arg2, arg3, arg4) -- line 760 if arg1:is_choring(arg2, FALSE, arg3) then arg1:set_chore_looping(arg2, FALSE, arg3) arg1:wait_for_chore(arg2, arg3) if arg4 then arg1:stop_chore(arg2, arg3) end end end Actor.complete_chore = function(arg1, arg2, arg3) -- line 774 if arg1:get_costume() and arg2 ~= nil then CompleteActorChore(arg1.hActor, arg2, arg3) end end Actor.set_chore_looping = function(arg1, arg2, arg3, arg4) -- line 785 if arg1:get_costume() then SetActorChoreLooping(arg1.hActor, arg2, arg3, arg4) end end Actor.stamp = function(arg1, arg2, arg3) -- line 799 if not Is3DHardwareEnabled() then if arg2 then arg1:complete_chore(arg2, arg3) while arg1:is_choring(arg2, FALSE, arg3) do break_here() end end ActorToClean(arg1.hActor) if arg2 then arg1:stop_chore(arg2, arg3) end end end Actor.unstamp = function(arg1) -- line 818 ForceRefresh() end Actor.stamp_test = function(arg1, arg2) -- line 822 while 1 do if arg2 then sleep_for(arg2) else sleep_for(1000) end ActorToClean(arg1.hActor) end end Actor.freeze = function(arg1, arg2, arg3, arg4) -- line 843 local local1 = { } if Is3DHardwareEnabled() then arg1:complete_chore(arg3, arg4) return end if GetActorCostume(arg1.hActor) then if system.currentSet == nil then PrintDebug("Actor:freeze() -- no current set!\n") return end if system.currentSet.frozen_actors == nil then system.currentSet.frozen_actors = { } end local1.actor = arg1 local1.pos = arg1:getpos() local1.rot = arg1:getrot() local1.preFreezeChore = arg2 local1.postFreezeChore = arg3 local1.freezeCostume = arg4 system.currentSet.frozen_actors[arg1.hActor] = local1 arg1:stamp(arg2, arg4) if arg3 then arg1:complete_chore(arg3, arg4) else arg1:put_in_set(nil) end arg1.frozen = system.currentSet end end Actor.refreeze = function(arg1) -- line 883 local local1 if arg1.frozen and arg1.frozen == system.currentSet then local1 = arg1.frozen.frozen_actors[arg1.hActor] if Is3DHardwareEnabled() then if local1.postFreezeChore then arg1:complete_chore(local1.postFreezeChore, local1.freezeCostume) end else arg1:put_in_set(arg1.frozen) arg1:setpos(local1.pos.x, local1.pos.y, local1.pos.z) arg1:setrot(local1.rot.x, local1.rot.y, local1.rot.z) arg1:stamp(local1.preFreezeChore, local1.freezeCostume) if local1.postFreezeChore then arg1:complete_chore(local1.postFreezeChore, local1.freezeCostume) else arg1:put_in_set(nil) end end end end Actor.thaw = function(arg1, arg2, arg3) -- line 916 local local1 if Is3DHardwareEnabled() and not arg3 then return end if GetActorCostume(arg1.hActor) then if not arg1.frozen then PrintDebug("Actor:thaw() -- Actor " .. arg1.name .. " isn't frozen!\n") return end arg1:put_in_set(arg1.frozen) local1 = arg1.frozen.frozen_actors[arg1.hActor] if local1 then arg1:setpos(local1.pos.x, local1.pos.y, local1.pos.z) arg1:setrot(local1.rot.x, local1.rot.y, local1.rot.z) end arg1.frozen.frozen_actors[arg1.hActor] = nil arg1.frozen = nil if arg2 then arg1:unstamp() system.currentSet:redraw_frozen_actors() end end end Actor.run_idle = function(arg1, arg2, arg3) -- line 950 local local1 = arg3 local local2 local local3 = system.currentSet while system.currentSet == local3 and local1 do PlayActorChore(arg1.hActor, local1) arg1.last_chore = chore wait_for_actor(arg1.hActor) local2 = pick_from_weighted_table(arg2[local1]) if local2 then local1 = local2 end end end Actor.new_run_idle = function(arg1, arg2, arg3, arg4, arg5) -- line 985 local local1 local local2 local local3 = system.currentSet local local4 arg1.stop_idle = FALSE arg1.last_play_chore = nil if arg3 then local4 = arg3 else local4 = arg1.idle_table end local1 = local4.root_name .. "_" .. arg2 if arg5 then arg1:print_costumes() PrintDebug("***\n") PrintDebug("Starting new_run_idle() with\n") PrintDebug("\ttable.root_name = " .. local4.root_name .. "\n") PrintDebug("\tstarting_chore = " .. arg2 .. "\n") PrintDebug("\tidle_table = " .. tostring(arg3) .. "\n") PrintDebug("\tcos = " .. arg4 .. "\n") PrintDebug("\tcurrent_chore = " .. local4.root_name .. "_" .. arg2 .. "\n") PrintDebug("***\n") end while system.currentSet == local3 and local1 and not arg1.stop_idle do if arg5 then PrintDebug(arg1.name .. " -- current chore:" .. getglobal(local1) .. "\n") end arg1:play_chore(getglobal(local1), arg4) arg1.last_chore = getglobal(local1) break_here() arg1:wait_for_chore(arg1.last_chore, arg4) if not arg1.stop_idle then if arg1.last_play_chore then if local4[arg1.last_play_chore] then local2 = arg1.last_play_chore arg1.stop_idle = TRUE arg1:play_chore(getglobal(local1), arg4) arg1.last_chore = local1 break_here() arg1:wait_for_chore(arg1.last_chore, arg4) else repeat local1 = arg1.stop_table[arg1.last_chore] arg1:play_chore(local1, arg4) arg1.last_chore = local1 arg1:wait_for_chore(arg1.last_chore, arg4) until local1 == arg1.last_play_chore arg1.stop_idle = TRUE end else local2 = pick_from_weighted_table(local4[local1]) end end if local2 then local1 = local2 end end end Actor.kill_idle = function(arg1, arg2) -- line 1063 local local1 if find_script(arg1.new_run_idle) then arg1.last_play_chore = arg2 while find_script(arg1.new_run_idle) do break_here() end end end Actor.wait_here = function(arg1, arg2) -- line 1078 repeat if arg1.stop_idle or arg1.is_talking then arg2 = 0 else arg2 = arg2 - 1 sleep_for(1000) end until arg2 <= 0 end Actor.talk_randomly_from_weighted_table = function(arg1, arg2, arg3, arg4) -- line 1101 local local1, local2 local local3 = system.currentSet if arg3 then local2 = arg3 else local2 = 2000 end if not arg4 then arg4 = { background = TRUE, skip_log = TRUE } end if type(arg2) == "table" then while system.currentSet == local3 do local1 = pick_from_weighted_table(arg2) if local1 then arg1:say_line(local1, arg4) arg1:wait_for_message() end sleep_for(local2 * random()) end end end Actor.wait_for_actor = function(arg1) -- line 1132 while arg1:is_moving() or arg1:is_turning() or arg1:is_choring(nil, TRUE) do break_here() end end Actor.wait_for_chore = function(arg1, arg2, arg3) -- line 1144 if not arg2 and not arg3 then arg2 = arg1.last_chore_played arg3 = arg1.last_cos_played end while arg1:is_choring(arg2, TRUE, arg3) do break_here() end end Actor.is_moving = function(arg1) -- line 1159 return IsActorMoving(arg1.hActor) end Actor.is_choring = function(arg1, arg2, arg3, arg4) -- line 1170 return IsActorChoring(arg1.hActor, arg2, arg3, arg4) end Actor.is_resting = function(arg1) -- line 1178 return IsActorResting(arg1.hActor) end Actor.is_turning = function(arg1) -- line 1186 return IsActorTurning(arg1.hActor) end Actor.set_costume = function(arg1, arg2) -- line 1197 local local1, local2 SetActorCostume(arg1.hActor, nil) arg1.base_costume = arg2 local1 = SetActorCostume(arg1.hActor, arg2) return local1 end Actor.is_walking = function(arg1) -- line 1209 if arg1:is_choring(arg1.walk_chore, TRUE, arg1.base_costume) then return TRUE else return FALSE end end Actor.get_costume = function(arg1, arg2) -- line 1221 return GetActorCostume(arg1.hActor, arg2) end Actor.print_costumes = function(arg1) -- line 1229 PrintActorCostumes(arg1.hActor) end Actor.push_costume = function(arg1, arg2) -- line 1242 PushActorCostume(arg1.hActor, arg2) end Actor.pop_costume = function(arg1) -- line 1254 if GetActorCostumeDepth(arg1.hActor) > 1 then return PopActorCostume(arg1.hActor) else PrintDebug("WARNING!! Trying to pop off last costume in stack!\n") return FALSE end end Actor.get_costume = function(arg1) -- line 1268 return GetActorCostume(arg1.hActor) end Actor.multi_pop_costume = function(arg1, arg2) -- line 1277 local local1 if arg2 then local1 = arg2 else local1 = 1 end while GetActorCostumeDepth(arg1.hActor) > local1 do arg1:pop_costume() end end Actor.set_talk_color = function(arg1, arg2) -- line 1295 SetActorTalkColor(arg1.hActor, arg2) end Actor.set_walk_chore = function(arg1, arg2, arg3) -- line 1303 arg1.walk_chore = arg2 if not arg3 then arg3 = arg1.base_costume end SetActorWalkChore(arg1.hActor, arg2, arg3) end Actor.set_turn_chores = function(arg1, arg2, arg3, arg4) -- line 1314 if not arg4 then arg4 = arg1.base_costume end SetActorTurnChores(arg1.hActor, arg2, arg3, arg4) end Actor.set_rest_chore = function(arg1, arg2, arg3) -- line 1324 if not arg3 then arg3 = arg1.base_costume end SetActorRestChore(arg1.hActor, arg2, arg3) end Actor.set_mumble_chore = function(arg1, arg2, arg3) -- line 1334 if not arg3 then arg3 = arg1.base_costume end SetActorMumblechore(arg1.hActor, arg2, arg3) end Actor.set_talk_chore = function(arg1, arg2, arg3, arg4) -- line 1345 if not arg4 then arg4 = arg1.base_costume end SetActorTalkChore(arg1.hActor, arg2, arg3, arg4) end Actor.set_turn_rate = function(arg1, arg2) -- line 1355 SetActorTurnRate(arg1.hActor, arg2) end Actor.set_walk_rate = function(arg1, arg2) -- line 1363 SetActorWalkRate(arg1.hActor, arg2) end Actor.set_head = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 1372 SetActorHead(arg1.hActor, arg2, arg3, arg4, arg5, arg6, arg7) end Actor.head_look_at = function(arg1, arg2, arg3) -- line 1381 if type(arg2) == "table" then if arg2.interest_actor then ActorLookAt(arg1.hActor, arg2.interest_actor.hActor, arg3) else ActorLookAt(arg1.hActor, arg2.hActor, arg3) end else ActorLookAt(arg1.hActor, nil, arg3) end end Actor.head_look_at_point = function(arg1, arg2, arg3, arg4, arg5) -- line 1404 if type(arg2) == "table" then ActorLookAt(arg1.hActor, arg2.x, arg2.y, arg2.z, arg3) else ActorLookAt(arg1.hActor, arg2, arg3, arg4, arg5) end end Actor.head_look_at_manny = function(arg1, arg2) -- line 1418 local local1, local2, local3 = GetActorNodeLocation(manny.hActor, 6) arg1:head_look_at_point(local1, local2, local3, arg2) end Actor.head_follow_mesh = function(arg1, arg2, arg3, arg4) -- line 1427 local local1, local2, local3 repeat local1, local2, local3 = GetActorNodeLocation(arg2.hActor, arg3) if local1 then arg1:head_look_at_point(local1, local2, local3) end break_here() until arg4 end Actor.kill_head_script = function(arg1) -- line 1442 if arg1.head_script then if find_script(arg1.head_script) then stop_script(arg1.head_script) end arg1.head_script = nil end end Actor.set_look_rate = function(arg1, arg2) -- line 1456 SetActorLookRate(arg1.hActor, arg2) end Actor.get_look_rate = function(arg1) -- line 1466 return GetActorLookRate(arg1.hActor) end Actor.set_visibility = function(arg1, arg2) -- line 1475 SetActorVisibility(arg1.hActor, arg2) end Actor.set_frustrum_culling = function(arg1, arg2) -- line 1489 SetActorFrustrumCull(arg1.hActor, arg2) end Actor.set_selected = function(arg1) -- line 1498 SetSelectedActor(arg1.hActor) system.currentActor = arg1 end Actor.find_sector_name = function(arg1, arg2) -- line 1509 return IsActorInSector(arg1.hActor, arg2) end Actor.find_sector_type = function(arg1, arg2) -- line 1519 if arg2 == nil then return GetActorSector(arg1.hActor, WALK) else return GetActorSector(arg1.hActor, arg2) end end Actor.follow_boxes = function(arg1) -- line 1527 SetActorFollowBoxes(arg1.hActor, TRUE) arg1.following_boxes = TRUE end Actor.ignore_boxes = function(arg1) -- line 1533 SetActorFollowBoxes(arg1.hActor, FALSE) arg1.following_boxes = FALSE end Actor.put_in_set = function(arg1, arg2) -- line 1544 if type(arg2) == "table" then doorman_in_hot_box = TRUE PutActorInSet(arg1.hActor, arg2.setFile) else PutActorInSet(arg1.hActor, nil) end end Actor.free = function(arg1) -- line 1557 PrintDebug("Freed actor " .. arg1.name .. "!!\n") if arg1.frozen then arg1.frozen.frozen_actors[arg1.hActor] = nil arg1.frozen = nil end arg1:stop_chore(nil) arg1:set_costume(nil) arg1:put_in_set(nil) end Actor.stop_walk = function(arg1) -- line 1574 local local1 = arg1:getpos() arg1:walkto(local1.x, local1.y, local1.z) end Actor.fake_walkto = function(arg1, arg2, arg3, arg4, arg5) -- line 1588 local local1, local2, local3 local local4 = GetActorWalkRate(arg1.hActor) local2 = { x = arg2, y = arg3, z = arg4 } local1 = GetActorYawToPoint(arg1.hActor, local2) arg1:setrot(0, local1, 0, TRUE) arg1:wait_for_actor() arg1.bob_script = start_script(arg1.fake_bob_walk, arg1, arg5) local3 = proximity(arg1.hActor, arg2, arg3, arg4) repeat local3 = proximity(arg1.hActor, arg2, arg3, arg4) if local3 <= PerSecond(GetActorWalkRate(arg1.hActor)) then arg1:set_walk_rate(local3 - 0.0099999998) end WalkActorForward(arg1.hActor) break_here() until local3 <= 0.050000001 stop_script(arg1.bob_script) arg1:setpos(arg2, arg3, arg4) arg1:set_walk_rate(local4) end Actor.fake_bob_walk = function(arg1, arg2) -- line 1612 local local1, local2, local3 if not arg2 then arg2 = 40 end local1 = arg1:getpos() local2 = local1.z local3 = 10 while TRUE do local1.z = local2 + sin(local3) / arg2 arg1:setpos(local1.x, local1.y, local1.z) local3 = local3 + rndint(10, 20) * (GetActorWalkRate(arg1.hActor) * 10) if local3 > 360 then local3 = local3 - 360 end break_here() local1 = arg1:getpos() end end Actor.put_at_interest = function(arg1) -- line 1638 PutActorAtInterest(arg1.hActor) end Actor.put_at_object = function(arg1, arg2) -- line 1647 if type(arg2) == "table" then PrintDebug("Putting " .. arg1.name .. " at object " .. arg2.name .. " in set " .. arg2.obj_set.name .. "\n") arg1:setpos(arg2.use_pnt_x, arg2.use_pnt_y, arg2.use_pnt_z) arg1:setrot(arg2.use_rot_x, arg2.use_rot_y, arg2.use_rot_z) arg1:put_in_set(arg2.obj_set) else PrintDebug("put_at_object(): invalid object!\n") end end Actor.clear_hands = function(arg1) -- line 1659 if arg1.is_holding then arg1.is_holding:put_away() end end Actor.set_speech_mode = function(arg1, arg2) -- line 1673 if not arg1.saylineTable then arg1.saylineTable = { } end arg1.saylineTable.background = arg2 end Actor.skip_log = function(arg1, arg2) -- line 1686 if not arg1.saylineTable then arg1.saylineTable = { } end arg1.saylineTable.skip_log = arg2 end Actor.normal_say_line = function(arg1, arg2, arg3) -- line 1698 local local1 local1 = union_table(arg1.saylineTable, arg3) if not local1.background then system.lastActorTalking = arg1 end SayLine(arg1.hActor, arg2, local1) if not local1.skip_log then dialog_log:log_say_line(arg1, arg2) end end Actor.underwater_say_line = function(arg1, arg2, arg3) -- line 1718 local local1 local1 = start_sfx("bubvox.imu") Actor.normal_say_line(arg1, arg2, arg3) start_script(arg1.wait_for_underwater_message, arg1, local1) end Actor.wait_for_underwater_message = function(arg1, arg2) -- line 1726 while IsMessageGoing(arg1.hActor) do break_here() end stop_sound(arg2) end Actor.say_line = Actor.normal_say_line Actor.wait_for_message = function(arg1) -- line 1736 while IsMessageGoing(arg1.hActor) do break_here() end end Actor.wait_and_say_line = function(arg1, arg2) -- line 1742 break_here() wait_for_message() arg1:say_line(arg2) end Actor.is_speaking = function(arg1) -- line 1748 if IsMessageGoing(arg1.hActor) then return TRUE else return FALSE end end Actor.shut_up = function(arg1) -- line 1760 ShutUpActor(arg1.hActor) end shut_up_everybody = function() -- line 1768 local local1, local2 local1, local2 = next(system.actorTable, nil) while local1 do if IsMessageGoing(local2.hActor) then ShutUpActor(local2.hActor) end local1, local2 = next(system.actorTable, local1) end end Actor.angle_to_actor = function(arg1, arg2) -- line 1785 return GetAngleBetweenActors(arg1.hActor, arg2.hActor) end Actor.angle_to_object = function(arg1, arg2) -- line 1793 return GetAngleBetweenActors(arg1.hActor, arg2.interest_actor.hActor) end Actor.voice_line = function(arg1, arg2, arg3, arg4, arg5) -- line 1805 if 1 then arg1:say_line(arg2.text, arg1.talk_in_background) else if not arg3 then arg3 = 3.5 end if not arg4 then arg4 = 3.5 end if not arg5 then arg5 = 1 end if text_mode == "Text Only" or text_mode == "Text and Voice" or not arg2.hSound then arg1:say_line(arg2.text, arg1.talk_in_background) end if arg2.hSound and text_mode ~= "Text Only" then PlaySoundAt(arg2.hSound, arg1.hActor, arg3, arg4, arg5) while IsSoundPlaying(arg2.hSound) do break_here() end end wait_for_message() end end Actor.has_any = function(arg1, arg2) -- line 1840 local local1, local2 = next(arg2, nil) while local1 do if type(local2) == "table" then if local2.owner == arg1 then return TRUE end end local1, local2 = next(arg2, local1) end return FALSE end print_actor_coordinates = function(arg1) -- line 1863 local local1, local2, local3 local local4, local5 if not arg1 then local4 = InputDialog("Actor Coordinates", "Enter name of actor (manny is the default):") if local4 == nil or local4 == "" then local4 = "manny" end local5 = getglobal(local4) else local5 = arg1 end if local5 ~= nil and type(local5) == "table" then local1 = local5:getpos() local2 = local5:get_positive_rot() local3 = local5:get_softimage_pos() if abs(local1.z) < 1e-06 then local1.z = 0 end PrintDebug(local4 .. ":setpos(" .. local1.x .. ", " .. local1.y .. ", " .. local1.z .. ")\n") PrintDebug(local4 .. ":setrot(" .. local2.x .. ", " .. local2.y .. ", " .. local2.z .. ")\n") PrintDebug(local4 .. ":set_softimage_pos(" .. local3.x .. ", " .. local3.y .. ", " .. local3.z .. ")\n") PrintDebug("start_script(" .. local4 .. ".walk_and_face," .. local4 .. "," .. local1.x .. ", " .. local1.y .. ", " .. local1.z .. ", " .. local2.x .. ", " .. local2.y .. ", " .. local2.z .. ")\n") else PrintDebug("Actor \"" .. local4 .. "\" not recognized!\n") end end system.idleTemplate = { } Idle = system.idleTemplate Idle.create = function(arg1, arg2) -- line 1906 local local1 = { } local1.parent = arg1 local1.root_name = arg2 return local1 end Idle.add_state = function(arg1, arg2, arg3) -- line 1913 local local1, local2 local local3, local4 if type(arg3) ~= "table" then PrintDebug("Not a valid branch_table for new state " .. arg2 .. "\n") return nil end local1 = arg1.root_name .. "_" .. arg2 arg1[local1] = { } local3, local4 = next(arg3, nil) while local3 do local2 = arg1.root_name .. "_" .. local3 arg1[local1][local2] = local4 local3, local4 = next(arg3, local3) end end run_idle = function(arg1, arg2, arg3) -- line 1945 local local1 = arg3 local local2 local local3 = system.currentSet while system.currentSet == local3 and local1 do PlayActorChore(arg1.hActor, local1) wait_for_actor(arg1.hActor) local2 = pick_from_weighted_table(arg2[local1]) if local2 then local1 = local2 end end end Actor.spin = function(arg1) -- line 1975 local local1, local2, local3 local local4 = 1 local1 = 1 local2 = 360 local3 = 1 while 1 do arg1:setrot(local1, local2, local3) local4 = local4 + 10 local1 = local1 + 10 local2 = local2 - 10 local3 = local3 + 10 if local4 == 361 then local1 = 1 local2 = 360 local3 = 1 end break_here() end end Actor.create_dialogStack = function(arg1) -- line 2013 arg1.dialogStack = { } arg1.dialogStack.parseFunction = nil arg1.dialogStack.head = 0 arg1.dialogStack.tail = 0 end Actor.push_chore = function(arg1, arg2, arg3, arg4, arg5) -- line 2028 if not arg2 then arg2 = "wait" end arg1.dialogStack[arg1.dialogStack.tail] = { chore = arg2, isLooping = arg3, fade_in_time = arg4, fade_out_time = arg5 } arg1.dialogStack.tail = arg1.dialogStack.tail + 1 if not find_script(arg1.execute_dialogStack) then arg1.dialogStack.parseFunction = start_script(arg1.execute_dialogStack, arg1) end PrintDebug("pushing chore " .. arg2 .. "\n") end Actor.push_chore_times = function(arg1, arg2, arg3) -- line 2051 local local1 local1 = 0 while local1 < arg3 do arg1:push_chore(arg2, CHORE_NOLOOP) arg1:push_chore() local1 = local1 + 1 end end Actor.push_break = function(arg1, arg2) -- line 2066 if not arg2 then arg2 = 1 end arg1.dialogStack[arg1.dialogStack.tail] = { chore = "break_here", frames = arg2 } arg1.dialogStack.tail = arg1.dialogStack.tail + 1 if arg1.dialogStack.parseFunction == nil then arg1.dialogStack.parseFunction = start_script(arg1.execute_dialogStack, arg1) end end Actor.push_sleep = function(arg1, arg2) -- line 2083 if not arg2 then arg2 = 1000 end arg1.dialogStack[arg1.dialogStack.tail] = { chore = "sleep_for", msecs = arg2 } arg1.dialogStack.tail = arg1.dialogStack.tail + 1 if arg1.dialogStack.parseFunction == nil then arg1.dialogStack.parseFunction = start_script(arg1.execute_dialogStack, arg1) end end Actor.execute_dialogStack = function(arg1) -- line 2107 local local1, local2 local local3 = arg1:get_costume(nil) local local4 local1 = arg1.dialogStack[arg1.dialogStack.head] while local1 ~= nil do PrintDebug("dialogStack: " .. local1.chore .. "\n") if local1.chore == "wait" then arg1:wait_for_chore() elseif local1.chore == "break_here" then local2 = 0 while local2 < local1.frames do break_here() local2 = local2 + 1 end elseif local1.chore == "sleep_for" then sleep_for(local1.msecs) elseif local1.isLooping == CHORE_LOOP then arg1:play_chore_looping(local1.chore) elseif local1.fade_in_time then PrintDebug("Fading in chore " .. local1.chore .. "\n") if local4 then arg1:blend(local1.chore, local4.chore, local1.fade_in_time, local3) else FadeInChore(arg1.hActor, local3, local1.chore, local1.fade_in_time) end else PrintDebug("playing chore " .. local1.chore .. "\n") arg1:play_chore(local1.chore) end if local1.fade_out_time then arg1:wait_for_chore() PrintDebug("Fading out chore " .. local1.chore .. "\n") FadeOutChore(arg1.hActor, local3, local1.chore, local1.fade_in_time) end if local1.chore ~= "wait" and local1.chore ~= "break_here" and local1 ~= "sleep_for" then local4 = local1 end arg1.dialogStack[arg1.dialogStack.head] = nil arg1.dialogStack.head = arg1.dialogStack.head + 1 local1 = arg1.dialogStack[arg1.dialogStack.head] end arg1.dialogStack.head = 0 arg1.dialogStack.tail = 0 arg1.dialogStack.parseFunction = nil end Actor.play_sound_at = function(arg1, arg2, arg3, arg4, arg5, arg6) -- line 2176 local local1 if not arg5 then arg5 = IM_HIGH_PRIORITY end if not arg6 then arg6 = IM_GROUP_SFX end local1 = ImStartSound(arg2, arg5, arg6) SetSoundPosition(local1, arg1.hActor, arg3, arg4) return local1 end Actor.move_sound_to = function(arg1, arg2, arg3, arg4) -- line 2196 SetSoundPosition(arg2, arg1.hActor, arg3, arg4) end Actor.play_attached_sound = function(arg1, arg2, arg3, arg4, arg5, arg6) -- line 2211 local local1 if not arg5 then arg5 = IM_HIGH_PRIORITY end if not arg6 then arg6 = IM_GROUP_SFX end ImStartSound(arg2, arg5, arg6) local1 = start_script(arg1.attach_sound, arg1, arg2, arg3, arg4) wait_for_script(local1) end Actor.attach_sound = function(arg1, arg2, arg3, arg4) -- line 2233 start_script(arg1.attach_sound_script, arg1, arg2, arg3, arg4) end Actor.attach_sound_script = function(arg1, arg2, arg3, arg4) -- line 2248 while sound_playing(arg2) do SetSoundPosition(arg2, arg1.hActor, arg3, arg4) end end Actor.play_footstep_sfx = function(arg1, arg2, arg3, arg4) -- line 2263 arg1:play_sound_at(arg2, arg3, arg4, IM_MED_PRIORITY) end Actor.costumeMarkerHandler = function(arg1, arg2, arg3) -- line 2274 local local1 = system.actorTable[arg2] local local2 = FALSE if local1 ~= nil then if local1.costume_marker_handler then local2 = TRUE local1:costume_marker_handler(arg3) elseif local1.costume_marker_handler == bird_sound_monitor then local2 = TRUE local1:costume_marker_handler(arg3) end end if not local2 and local1 ~= nil and local1.footsteps ~= nil and not local1:is_resting() then local1:play_default_footstep(arg3) end end Actor.play_default_footstep = function(arg1, arg2, arg3) -- line 2298 local local1 local local2, local3 local local4, local5 if not arg3 then local1 = arg1.footsteps else local1 = arg3 end local2 = local1.prefix local3 = nil local4 = 10 local5 = 64 if arg2 == Actor.MARKER_LEFT_WALK then local2 = local2 .. "wl" local3 = rndint(1, local1.left_walk) elseif arg2 == Actor.MARKER_RIGHT_WALK then local2 = local2 .. "wr" local3 = rndint(1, local1.right_walk) elseif arg2 == Actor.MARKER_LEFT_TURN then local2 = local2 .. "wl" local3 = rndint(1, local1.left_walk) local4 = 5 local5 = 20 elseif arg2 == Actor.MARKER_RIGHT_TURN then local2 = local2 .. "wr" local3 = rndint(1, local1.right_walk) local4 = 5 local5 = 20 elseif arg2 == Actor.MARKER_LEFT_RUN then if local1.left_run and local1.left_run > 0 then local2 = local2 .. "rl" local3 = rndint(1, local1.left_run) else local2 = local2 .. "wl" local3 = rndint(1, local1.left_walk) end elseif arg2 == Actor.MARKER_RIGHT_RUN then if local1.right_run and local1.right_run > 0 then local2 = local2 .. "rr" local3 = rndint(1, local1.right_run) else local2 = local2 .. "wr" local3 = rndint(1, local1.right_walk) end end if local3 then local2 = local2 .. local3 .. ".wav" arg1:play_footstep_sfx(local2, local4, local5) end end Actor.costumeOverrideHandler = function(arg1, arg2, arg3) -- line 2356 if arg3 then arg1.idles_allowed = FALSE else arg1.idles_allowed = TRUE end end Actor.collisionHandler = function(arg1, arg2, arg3) -- line 2364 local local1 = system.actorTable[arg2] local local2 = system.actorTable[arg3] if local1 ~= nil then if local1.collision_handler then PrintDebug(local1.name .. " has run into " .. local2.name) single_start_script(local1.collision_handler, local1, local2) end end end Actor.collision_handler = function(arg1, arg2) -- line 2376 end system.costumeMarkerHandler = Actor system.costumeOverrideHandler = Actor system.collisionHandler = Actor footsteps = { } footsteps.concrete = { prefix = "fscon", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.dirt = { prefix = "fsdrt", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.gravel = { prefix = "fsgrv", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.creak = { prefix = "fscrk", left_walk = 2, right_walk = 2, left_run = 2, right_run = 2 } footsteps.marble = { prefix = "fsmar", left_walk = 2, right_walk = 2, left_run = 2, right_run = 2 } footsteps.metal = { prefix = "fsmet", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.pavement = { prefix = "fspav", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.rug = { prefix = "fsrug", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.sand = { prefix = "fssnd", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.snow = { prefix = "fssno", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.trapdoor = { prefix = "fstrp", left_walk = 1, right_walk = 1, left_run = 1, right_run = 1 } footsteps.echo = { prefix = "fseko", left_walk = 4, right_walk = 4, left_run = 4, right_run = 4 } footsteps.reverb = { prefix = "fsrvb", left_walk = 2, right_walk = 2, left_run = 2, right_run = 2 } footsteps.metal2 = { prefix = "fs3mt", left_walk = 4, right_walk = 4, left_run = 2, right_run = 2 } footsteps.wet = { prefix = "fswet", left_walk = 2, right_walk = 2, left_run = 2, right_run = 2 } footsteps.flowers = { prefix = "fsflw", left_walk = 2, right_walk = 2, left_run = 2, right_run = 2 } footsteps.glottis = { prefix = "fsglt", left_walk = 2, right_walk = 2 } footsteps.jello = { prefix = "fsjll", left_walk = 2, right_walk = 2 } footsteps.nick_virago = { prefix = "fsnic", left_walk = 2, right_walk = 2 } footsteps.underwater = { prefix = "fswtr", left_walk = 3, right_walk = 3, left_run = 2, right_run = 2 } footsteps.velasco = { prefix = "fsbcn", left_walk = 3, right_walk = 2 } brennis = Actor:create(nil, nil, nil, "Tube-Switcher Guy") brennis:set_talk_color(Red) brennis.default = function(arg1) -- line 2441 brennis:set_costume("brennis_fix_idle.cos") brennis:set_colormap("brennis.cmp") brennis:set_mumble_chore(brennis_fix_idle_mumble) brennis:set_talk_chore(1, brennis_fix_idle_stop_talk) brennis:set_talk_chore(2, brennis_fix_idle_a) brennis:set_talk_chore(3, brennis_fix_idle_c) brennis:set_talk_chore(4, brennis_fix_idle_e) brennis:set_talk_chore(5, brennis_fix_idle_f) brennis:set_talk_chore(6, brennis_fix_idle_l) brennis:set_talk_chore(7, brennis_fix_idle_m) brennis:set_talk_chore(8, brennis_fix_idle_o) brennis:set_talk_chore(9, brennis_fix_idle_t) brennis:set_talk_chore(10, brennis_fix_idle_u) end celso = Actor:create(nil, nil, nil, "Celso") celso:set_talk_color(Yellow) chepito = Actor:create(nil, nil, nil, "Chepito") chepito.default = function(arg1) -- line 2463 if not chepito.hCos then chepito.hCos = "chepito.cos" end chepito:set_visibility(TRUE) chepito:set_costume(chepito.hCos) chepito:set_talk_color(Green) chepito:set_walk_chore(chepito_walk) chepito:set_mumble_chore(chepito_mumble) chepito:set_talk_chore(1, chepito_m) chepito:set_talk_chore(2, chepito_a) chepito:set_talk_chore(3, chepito_c) chepito:set_talk_chore(4, chepito_e) chepito:set_talk_chore(5, chepito_f) chepito:set_talk_chore(6, chepito_l) chepito:set_talk_chore(7, chepito_m) chepito:set_talk_chore(8, chepito_o) chepito:set_talk_chore(9, chepito_t) chepito:set_talk_chore(10, chepito_u) chepito:set_head(3, 4, 5, 165, 28, 80) end domino = Actor:create(nil, nil, nil, "Domino") domino:set_talk_color(Yellow) domino.default = function(arg1) -- line 2490 domino:set_colormap("domino.cmp") domino:set_talk_color(Yellow) end eva = Actor:create(nil, nil, nil, "/sytx088/") eva:set_talk_color(Red) eva.default = function(arg1, arg2) -- line 2497 if arg2 == "sec" then eva:set_costume("eva_sec.cos") eva:set_mumble_chore(eva_sec_mumble, "eva_sec.cos") eva:set_talk_chore(1, eva_sec_mouth_m) eva:set_talk_chore(2, eva_sec_mouth_a) eva:set_talk_chore(3, eva_sec_mouth_c) eva:set_talk_chore(4, eva_sec_mouth_e) eva:set_talk_chore(5, eva_sec_mouth_f) eva:set_talk_chore(6, eva_sec_mouth_l) eva:set_talk_chore(7, eva_sec_mouth_m) eva:set_talk_chore(8, eva_sec_mouth_o) eva:set_talk_chore(9, eva_sec_mouth_t) eva:set_talk_chore(10, eva_sec_mouth_u) else eva:set_costume("ev_r_idles.cos") end eva:set_colormap("eva_sv.cmp") eva:set_talk_color(Red) eva:ignore_boxes() end manny = Actor:create(nil, nil, nil, "Manny") manny.costume_state = "suit" dofile("_manny.lua") meche = Actor:create(nil, nil, nil, "Meche") meche:set_talk_color(Green) dofile("olivia_talks.lua") olivia = Actor:create(nil, nil, nil, "Olivia") olivia:set_talk_color(MakeColor(164, 18, 147)) olivia.default = function(arg1) -- line 2531 olivia:set_costume(nil) olivia:set_costume("olivia_talks.cos") olivia:set_mumble_chore(olivia_talks_mumble, "olivia_talks.cos") olivia:set_talk_chore(1, olivia_talks_stop_talk) olivia:set_talk_chore(2, olivia_talks_a) olivia:set_talk_chore(3, olivia_talks_c) olivia:set_talk_chore(4, olivia_talks_e) olivia:set_talk_chore(5, olivia_talks_f) olivia:set_talk_chore(6, olivia_talks_l) olivia:set_talk_chore(7, olivia_talks_m) olivia:set_talk_chore(8, olivia_talks_o) olivia:set_talk_chore(9, olivia_talks_t) olivia:set_talk_chore(10, olivia_talks_u) olivia:push_costume("olivia_idles.cos") olivia:set_walk_chore(olivia_idles_walk, "olivia_idles.cos") olivia:set_head(5, 6, 7, 165, 28, 80) olivia:set_look_rate(110) olivia:set_collision_mode(COLLISION_SPHERE, 0.2) end salvador = Actor:create(nil, nil, nil, "/sytx198/") salvador:set_talk_color(DarkGreen) salvador.default = function(arg1) -- line 2556 salvador:ignore_boxes() if not salvador.hCos then salvador.hCos = "sv_in_hq.cos" end salvador:set_costume(salvador.hCos) salvador:set_colormap("eva_sv.cmp") salvador:set_head(3, 4, 5, 165, 28, 80) salvador:set_look_rate(90) end toto = Actor:create(nil, nil, nil, "Toto") toto.default = function(arg1) -- line 2568 toto:set_colormap("toto.cmp") toto:set_talk_color(Yellow) end dofile("velasco.lua") velasco = Actor:create(nil, nil, nil, "Velasco") velasco.default = function(arg1) -- line 2575 velasco:free() velasco:set_costume("velasco.cos") velasco:set_colormap("velasco.cmp") velasco:set_talk_color(Blue) velasco:set_head(3, 4, 5, 165, 28, 80) velasco:set_walk_rate(0.38) velasco:set_look_rate(180) velasco:set_mumble_chore(velasco_mumble) velasco:set_talk_chore(1, velasco_stop_talk) velasco:set_talk_chore(2, velasco_a) velasco:set_talk_chore(3, velasco_c) velasco:set_talk_chore(4, velasco_e) velasco:set_talk_chore(5, velasco_f) velasco:set_talk_chore(6, velasco_l) velasco:set_talk_chore(7, velasco_m) velasco:set_talk_chore(8, velasco_o) velasco:set_talk_chore(9, velasco_t) velasco:set_talk_chore(10, velasco_u) velasco:set_turn_rate(85) velasco:set_collision_mode(COLLISION_OFF) velasco:set_walk_chore(velasco_walk, "velasco.cos") end dofile("_actors1.lua") dofile("_actors2.lua") dofile("_actors3.lua") dofile("_actors4.lua") CheckFirstTime("nq.lua") nq = Set:create("nq.set", "New Headquarters", { nq_intha = 0, nq_ovrhd = 1 }) dofile("ev_stand_idles.lua") dofile("nq_tape.lua") dofile("meche_ruba.lua") dofile("meche_snow.lua") nq.the_plan = function() -- line 17 local local1 = { } START_CUT_SCENE() meche.footsteps = footsteps.concrete meche_idle_ok = FALSE manny:walkto_object(nq.meche_obj) manny:head_look_at(nil) eva:head_follow_mesh(meche, 6, TRUE) manny:say_line("/nqma031/") wait_for_message() manny:say_line("/nqma032/") wait_for_message() manny:say_line("/nqma033/") wait_for_message() meche:say_line("/nqmc034/") wait_for_message() stop_script(meche.head_follow_mesh) eva:say_line("/nqev035/") meche:head_follow_mesh(eva, 6, TRUE) wait_for_message() meche:head_look_at(nil) eva:head_look_at(nil) MakeSectorActive("meche_box", FALSE) meche:follow_boxes() meche:set_collision_mode(COLLISION_OFF) meche:head_look_at_manny() start_script(meche.walkto, meche, nq.lw_door, TRUE) sleep_for(1000) meche:say_line("/nqmc036/") meche:wait_for_actor() meche:free() eva:say_line("/nqev037/") manny:head_look_at(nil) local1 = eva:getpos() while TurnActorTo(manny.hActor, local1.x, local1.y, local1.z) do break_here() end eva:say_line("/nqev037/") wait_for_message() manny:say_line("/nqma038/") wait_for_message() manny:say_line("/nqma039/") wait_for_message() END_CUT_SCENE() nq.meche_obj:make_untouchable() end nq.bowlsley_cam = function() -- line 65 if not bowlsley_in_hiding then if not nq.pigeon.en_route then START_CUT_SCENE("no head") system:lock_display() StartMovie("cam_cyc.snm", TRUE) manny:set_visibility(FALSE) meche:set_visibility(FALSE) eva:set_visibility(FALSE) if not little_manny.dead then little_manny:set_visibility(FALSE) end if not nq.picked_up_arm then arm_actor:set_visibility(FALSE) end nq.remains:play_chore(1) nq.tape_recorder:play_chore(nq_tape_gone) system:unlock_display() music_state:set_state(stateFVID) if not nq.seen_bowlsley then nq.seen_bowlsley = TRUE wait_for_message() sleep_for(1000) manny:say_line("/nqma040/") manny:wait_for_message() eva:say_line("/nqev041/") eva:wait_for_message() eva:say_line("/nqev042/") eva:wait_for_message() eva:say_line("/nqev043/") eva:wait_for_message() eva:say_line("/nqev044/") eva:wait_for_message() eva:say_line("/nqev045/") eva:wait_for_message() manny:say_line("/nqma046/") eva:wait_for_message() manny:say_line("/nqma047/") manny:wait_for_message() eva:say_line("/nqev048/") eva:wait_for_message() eva:say_line("/nqev049/") eva:wait_for_message() manny:say_line("/nqma050/") nq:restore_from_movie() else set_override(nq.esc_from_camera) sleep_for(1000) manny:say_line("/nqma051/") system.buttonHandler = camera_button_handler end END_CUT_SCENE() else cur_puzzle_state[52] = TRUE nq.pigeon.en_route = FALSE start_script(cut_scene.eatbird) end else nq.say_nothing_but() end end nq.esc_from_camera = function() -- line 149 system.buttonHandler = SampleButtonHandler start_script(nq.restore_from_movie) end camera_button_handler = function(arg1, arg2, arg3) -- line 154 if not CommonButtonHandler(arg1, arg2, arg3) then if arg2 then nq.esc_from_camera() end end end nq.restore_from_movie = function(arg1) -- line 162 system:lock_display() StopMovie() break_here() ForceRefresh() manny:set_visibility(TRUE) meche:set_visibility(TRUE) eva:set_visibility(TRUE) if not little_manny.dead then little_manny:set_visibility(TRUE) end if not nq.picked_up_arm then arm_actor:set_visibility(TRUE) end nq.remains:play_chore(0) sleep_for(250) music_state:update() system:unlock_display() end nq.say_nothing_but = function() -- line 185 manny:say_line("/nqma052/") end nq.dead_cam = function(arg1) -- line 190 if not nq.seen_dead_cam then nq.seen_dead_cam = TRUE if not arg1.seen then arg1.seen = TRUE manny:say_line("/nqma053/") wait_for_message() manny:say_line("/nqma054/") else nq.say_nothing_but() end elseif not arg1.seen then arg1.seen = TRUE manny:say_line("/nqma055/") wait_for_message() manny:say_line("/nqma056/") else nq.say_nothing_but() end end nq.eva_idles = function(arg1) -- line 213 local local1 eva:play_chore(ev_stand_idle_stand_idle) while 1 do if not eva.stop_idle then local1 = rndint(1, 3) eva:play_chore(local1) eva:wait_for_chore() eva:wait_here(rnd(1, 3)) end break_here() end end nq.idle_little_manny = function() -- line 227 nq.pigeon_ilde_ok = TRUE while 1 do if nq.pigeon_ilde_ok then if rnd() then little_manny:play_chore(pigeon_idles_stopwalk_cycle) else little_manny:play_chore(pigeon_idles_head_turns) end if rnd() then little_manny:play_sound_at("pigeon3.wav") else little_manny:play_sound_at("wings4.wav") end little_manny:wait_for_chore() sleep_for(rnd(3000, 6000)) else break_here() end end end nq.meche_arm_idle = function() -- line 249 meche:play_chore(meche_in_vi_xarms) meche:wait_for_chore() meche_idle_ok = TRUE while meche_idle_ok do meche:play_chore(meche_ruba_drop_hands) meche:wait_for_chore() vi.meche_hold(5, 9) meche:play_chore(meche_ruba_xarms) meche:wait_for_chore() vi.meche_hold(5, 9) end meche:play_chore(meche_ruba_drop_hands) meche:wait_for_chore() end nq.set_up_actors = function(arg1) -- line 268 eva:set_costume("ev_stand_idles.cos") eva:put_in_set(nq) eva:ignore_boxes() eva:set_mumble_chore(ev_stand_idles_mumble) eva:set_talk_chore(1, ev_stand_idles_stop_talk) eva:set_talk_chore(2, ev_stand_idles_a) eva:set_talk_chore(3, ev_stand_idles_c) eva:set_talk_chore(4, ev_stand_idles_e) eva:set_talk_chore(5, ev_stand_idles_f) eva:set_talk_chore(6, ev_stand_idles_l) eva:set_talk_chore(7, ev_stand_idles_m) eva:set_talk_chore(8, ev_stand_idles_o) eva:set_talk_chore(9, ev_stand_idles_t) eva:set_talk_chore(10, ev_stand_idles_u) eva:setpos(-0.3296, -0.00454, 0) eva:setrot(0, -99.1731, 0) eva:set_head(3, 4, 5, 165, 28, 80) eva:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(eva.hActor, 0.3) start_script(nq.eva_idles) manny:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(manny.hActor, 0.35) if not little_manny then little_manny = Actor:create(nil, nil, nil, "little manny") end if not little_manny.dead then little_manny:follow_boxes() little_manny:set_costume("pigeon_idles.cos") little_manny:set_colormap("pigeons.cmp") little_manny:put_in_set(nq) little_manny:ignore_boxes() little_manny:setpos(-0.342759, 0.825031, 0.522623) little_manny:setrot(0, 188, 0) start_script(nq.idle_little_manny) end if nq.meche_obj.touchable then box_on("meche_box") meche:set_costume(nil) meche:set_costume("meche_snow.cos") meche:set_mumble_chore(meche_snow_mumble, "meche_snow.cos") meche:set_talk_chore(1, meche_snow_stop_talk) meche:set_talk_chore(2, meche_snow_a) meche:set_talk_chore(3, meche_snow_c) meche:set_talk_chore(4, meche_snow_e) meche:set_talk_chore(5, meche_snow_f) meche:set_talk_chore(6, meche_snow_l) meche:set_talk_chore(7, meche_snow_m) meche:set_talk_chore(8, meche_snow_o) meche:set_talk_chore(9, meche_snow_t) meche:set_talk_chore(10, meche_snow_u) meche:set_head(5, 5, 5, 165, 28, 80) meche:set_walk_chore(meche_snow_walk, "meche_snow.cos") meche:set_look_rate(200) meche:put_in_set(nq) meche:ignore_boxes() meche:setpos(0.9, 1, 0) meche:setrot(0, -204, 0) meche:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(meche.hActor, 0.5) start_script(nq.meche_arm_idle) start_script(meche.head_follow_mesh, meche, manny, 5) else MakeSectorActive("meche_box", FALSE) end if not arm_actor then arm_actor = Actor:create(nil, nil, nil, "arm") end if not nq.picked_up_arm then arm_actor:set_costume("arm_actor.cos") arm_actor:put_in_set(nq) arm_actor:setpos({ x = 0.742541, y = -0.0746845, z = -0.007 }) arm_actor:setrot(0, 90, 89) arm_actor:play_chore_looping(0) end end radio_table = { "radio1.wav", "radio2.wav", "radio3.wav", "cpuBeep1.wav", "cpuBeep2.wav", "cpuBeep3.wav", "cpuArrow.wav", "compBeep.wav", "intrCom.wav", "typeCr.wav" } nq.radio_sfx = function(arg1) -- line 350 local local1 while 1 do sleep_for(15000) if not find_script(cut_scene.eatbird) then local1 = pick_from_nonweighted_table(radio_table, TRUE) start_sfx(local1, 32) end end end nq.enter = function(arg1) -- line 368 nq:set_up_actors() NewObjectState(nq_intha, OBJSTATE_UNDERLAY, "nq_sprout.bm") nq.remains:set_object_state("nq_body.cos") nq.remains:play_chore(0) nq.tape_recorder.hObjectState = nq:add_object_state(nq_intah, "nq_tape.bm", nil, OBJSTATE_UNDERLAY, FALSE) nq.tape_recorder:set_object_state("nq_tape.cos") start_script(nq.radio_sfx) SetShadowColor(6, 6, 6) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 0, 0, 10) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") SetActiveShadow(meche.hActor, 0) SetActorShadowPoint(meche.hActor, 0, 0, 10) SetActorShadowPlane(meche.hActor, "shadow1") AddShadowPlane(meche.hActor, "shadow1") SetActiveShadow(eva.hActor, 0) SetActorShadowPoint(eva.hActor, 0, 0, 10) SetActorShadowPlane(eva.hActor, "shadow1") AddShadowPlane(eva.hActor, "shadow1") SetActiveShadow(manny.hActor, 1) SetActorShadowPoint(manny.hActor, 0, 0, 10) SetActorShadowPlane(manny.hActor, "shadow2") AddShadowPlane(manny.hActor, "shadow2") SetActiveShadow(meche.hActor, 1) SetActorShadowPoint(meche.hActor, 0, 0, 10) SetActorShadowPlane(meche.hActor, "shadow2") AddShadowPlane(meche.hActor, "shadow2") SetActiveShadow(manny.hActor, 2) SetActorShadowPoint(manny.hActor, 0, 0, 10) SetActorShadowPlane(manny.hActor, "shadow3") AddShadowPlane(manny.hActor, "shadow3") SetActiveShadow(meche.hActor, 2) SetActorShadowPoint(meche.hActor, 0, 0, 10) SetActorShadowPlane(meche.hActor, "shadow3") AddShadowPlane(meche.hActor, "shadow3") end nq.exit = function(arg1) -- line 421 eva:free() stop_script(nq.radio_sfx) stop_script(nq.eva_idles) little_manny:free() stop_script(nq.idle_little_manny) manny:set_collision_mode(COLLISION_OFF) KillActorShadows(manny.hActor) KillActorShadows(meche.hActor) KillActorShadows(eva.hActor) end nq.meche_obj = Object:create(nq, "Meche", 0.91113698, 0.984411, 0.51099998, { range = 0.89999998 }) nq.meche_obj.use_pnt_x = 0.72313702 nq.meche_obj.use_pnt_y = 0.739411 nq.meche_obj.use_pnt_z = 0 nq.meche_obj.use_rot_x = 0 nq.meche_obj.use_rot_y = -1843.97 nq.meche_obj.use_rot_z = 0 nq.meche_obj.lookAt = function(arg1) -- line 457 manny:say_line("/nqma058/") end nq.meche_obj.pickUp = function(arg1) -- line 461 system.default_response("not now") end nq.meche_obj.use = function(arg1) -- line 465 start_script(nq.the_plan) end nq.meche_obj.use_hand = function(arg1) -- line 469 START_CUT_SCENE() manny:walkto(0.693852, 0.844436, -0.00303789, 0, 318.127, 0) manny:wait_for_actor() manny:wait_for_actor() manny:play_chore(msb_use_obj, manny.base_costume) manny:say_line("/lrma008/") manny:wait_for_message() meche:say_line("/nqmc059/") manny:wait_for_chore(msb_use_obj, manny.base_costume) manny:stop_chore(msb_use_obj, manny.base_costume) END_CUT_SCENE() end nq.meche_obj.use_lsa_photo = function(arg1) -- line 483 meche:say_line("/nqmc060/") end nq.monitor1 = Object:create(nq, "/nqtx001/monitor", -0.59216201, 0.28474399, 0.47, { range = 0.60000002 }) nq.monitor1.use_pnt_x = -0.48111799 nq.monitor1.use_pnt_y = 0.28467101 nq.monitor1.use_pnt_z = 0 nq.monitor1.use_rot_x = 0 nq.monitor1.use_rot_y = -2793.6799 nq.monitor1.use_rot_z = 0 nq.monitor1.lookAt = function(arg1) -- line 496 START_CUT_SCENE() manny:walkto_object(arg1) manny:wait_for_actor() start_script(nq.bowlsley_cam) END_CUT_SCENE() end nq.monitor1.pickUp = function(arg1) -- line 504 system.default_response("attached") end nq.monitor1.use = nq.monitor1.lookAt nq.monitor2 = Object:create(nq, "/nqtx008/monitor", -0.80216199, -0.045256399, 0.5, { range = 0.60000002 }) nq.monitor2.use_pnt_x = -0.63804001 nq.monitor2.use_pnt_y = -0.048541501 nq.monitor2.use_pnt_z = 0 nq.monitor2.use_rot_x = 0 nq.monitor2.use_rot_y = -2782.29 nq.monitor2.use_rot_z = 0 nq.monitor2.pickUp = function(arg1) -- line 518 system.default_response("attached") end nq.monitor2.use = function(arg1) -- line 522 start_script(nq.dead_cam, arg1) end nq.monitor2.lookAt = nq.monitor2.use nq.monitor3 = Object:create(nq, "/nqtx009/monitor", -0.78216201, 0.55474401, 0.5, { range = 0.64999998 }) nq.monitor3.use_pnt_x = -0.56171501 nq.monitor3.use_pnt_y = 0.425107 nq.monitor3.use_pnt_z = 0 nq.monitor3.use_rot_x = 0 nq.monitor3.use_rot_y = -2813.8701 nq.monitor3.use_rot_z = 0 nq.monitor3.lookAt = function(arg1) -- line 536 start_script(nq.dead_cam, arg1) end nq.monitor3.pickUp = function(arg1) -- line 540 system.default_response("attached") end nq.monitor3.use = nq.monitor3.lookAt nq.pigeon = Object:create(nq, "/nqtx010/pigeon", -0.33384299, 0.79816997, 0.61000001, { range = 0.85000002 }) nq.pigeon.use_pnt_x = -0.252049 nq.pigeon.use_pnt_y = 0.51655197 nq.pigeon.use_pnt_z = 0 nq.pigeon.use_rot_x = 0 nq.pigeon.use_rot_y = 6.4552002 nq.pigeon.use_rot_z = 0 nq.pigeon.lookAt = function(arg1) -- line 556 if not arg1.noted then if arg1.bit then manny:say_line("/nqma014/") else manny:say_line("/nqma011/") end else manny:say_line("/nqma061/") end end nq.pigeon.pickUp = function(arg1) -- line 568 if nq.pigeon.bit then system.default_response("got some") elseif manny:walkto_object(arg1) then START_CUT_SCENE() nq.pigeon.bit = TRUE nq.pigeon_ilde_ok = FALSE manny:say_line("/nqma012/") manny:wait_for_actor() manny:wait_for_message() manny:play_chore(msb_reach_high, manny.base_costume) sleep_for(1000) little_manny:play_chore(pigeon_idles_pecking) start_sfx("nqChomp.wav") wait_for_sound("nqChomp.wav") manny:say_line("/nqma013/") wait_for_message() manny:say_line("/nqma014/") manny:wait_for_chore() nq.pigeon_ilde_ok = TRUE END_CUT_SCENE() end end nq.pigeon.use = nq.pigeon.pickUp nq.pigeon.use_note = function(arg1) -- line 596 arg1.noted = TRUE START_CUT_SCENE() nq.pigeon_ilde_ok = FALSE manny:walkto_object(arg1) manny:wait_for_actor() manny:say_line("/nqma015/") wait_for_message() manny.is_holding = nil manny:stop_chore(msb_hold, manny.base_costume) if manny.fancy then manny:stop_chore(mcc_thunder_hold_note, manny.base_costume) manny:play_chore(mcc_thunder_activate_note, manny.base_costume) else manny:stop_chore(msb_hold_note, manny.base_costume) manny:play_chore(msb_activate_note, manny.base_costume) end manny:play_chore(msb_reach_high, manny.base_costume) manny:say_line("/nqma016/") sleep_for(1000) if manny.fancy then manny:stop_chore(mcc_thunder_activate_note, manny.base_costume) else manny:stop_chore(msb_activate_note, manny.base_costume) end start_sfx("tgPullNt.wav") manny:wait_for_chore() tg.note:free() nq.pigeon_ilde_ok = TRUE END_CUT_SCENE() end nq.pigeon_fly_sfx = function(arg1) -- line 629 local local1 while 1 do local1 = pick_one_of({ "wings1.wav", "wings2.wav", "wings3.wav", "wings4.wav", "wings5.wav", "wings6.wav", "wings7.wav", "wings8.wav" }) start_sfx(local1) while sound_playing(local1) do break_here() end end end nq.pigeon.use_lsa_photo = function(arg1) -- line 642 if not arg1.noted then manny:say_line("/nqma017/") else START_CUT_SCENE() stop_script(nq.idle_little_manny) little_manny.dead = TRUE arg1:make_untouchable() manny:walkto_object(arg1) manny:wait_for_actor() manny:say_line("/jbma078/") manny:play_chore(msb_reach_high, manny.base_costume) manny:wait_for_chore() manny:wait_for_message() nq.pigeon.en_route = TRUE music_state:set_sequence(seqPigeonFly) start_script(nq.pigeon_fly_sfx) little_manny:play_chore(pigeon_idles_short_takeoff) manny:play_chore(msb_reach_low, manny.base_costume) little_manny:wait_for_chore() little_manny:play_chore_looping(pigeon_idles_fly_cycle) manny:say_line("/nqma062/") little_manny:set_turn_rate(55) while TurnActorTo(little_manny.hActor, 0.518063, 1.62193, 0.522623) do little_manny:walk_forward() break_here() end manny:wait_for_chore() manny:stop_chore(msb_reach_low, manny.base_costume) repeat TurnActorTo(little_manny.hActor, -1.17, 2.12, 0.522623) little_manny:walk_forward() break_here() until little_manny:find_sector_name("little_manny") stop_script(nq.pigeon_fly_sfx) little_manny:free() nq.monitor1:lookAt() END_CUT_SCENE() manny:clear_hands() end end nq.pigeon.use_hand = function(arg1) -- line 688 START_CUT_SCENE() manny:say_line("/nqma063/") manny:walkto_object(arg1) manny:wait_for_actor() manny:wait_for_message() manny:stop_chore(msb_hold, manny.base_costume) manny:play_chore(msb_reach_high, manny.base_costume) sleep_for(1000) manny:say_line("/nqma064/") manny:wait_for_chore() manny:stop_chore(msb_reach_high, manny.base_costume) manny:play_chore_looping(msb_hold, manny.base_costume) END_CUT_SCENE() end nq.wastebasket = Object:create(nq, "/nqtx018/wastebasket", 0.216911, 0.86986101, 0.26499999, { range = 0.55000001 }) nq.wastebasket.use_pnt_x = 0.264595 nq.wastebasket.use_pnt_y = 0.71353102 nq.wastebasket.use_pnt_z = 0 nq.wastebasket.use_rot_x = 0 nq.wastebasket.use_rot_y = -317.17899 nq.wastebasket.use_rot_z = 0 nq.wastebasket.lookAt = function(arg1) -- line 713 if not arg1.searched then START_CUT_SCENE("no head") manny:head_look_at(arg1) manny:walkto(arg1) manny:wait_for_actor() manny:play_chore(msb_reach_med, manny.base_costume) sleep_for(300) start_sfx("nqGarbCn.wav") sleep_for(450) manny:blend(msb_hold, msb_reach_med, 1000, manny.base_costume) manny:wait_for_chore() arg1.searched = TRUE nq.photo:get() manny:head_look_at(nil) manny.is_holding = nq.photo if manny.fancy then manny:play_chore_looping(mcc_thunder_activate_lsa_photo, manny.base_costume) manny.hold_chore = mcc_thunder_activate_lsa_photo else manny:play_chore_looping(msb_activate_lsa_photo, "msb.cos") manny.hold_chore = msb_activate_lsa_photo end manny:play_chore_looping(msb_hold, manny.base_costume) wait_for_sound("nqGarbCn.wav") manny:say_line("/nqma021/") manny:setrot(0, 81.2567, 0, TRUE) manny:wait_for_actor() look_at_item_in_hand(TRUE) manny:wait_for_message() END_CUT_SCENE() else manny:say_line("/nqma019/") end end nq.wastebasket.use = nq.wastebasket.lookAt nq.wastebasket.searched = FALSE nq.wastebasket.pickUp = function(arg1) -- line 753 arg1:lookAt() end nq.wastebasket.use_note = function(arg1) -- line 757 manny:say_line("/nqma065/") end nq.wastebasket.use_hand = function(arg1) -- line 761 manny:say_line("/nqma066/") end nq.wastebasket.use_lsa_photo = function(arg1) -- line 765 if little_manny.dead then manny:walkto(arg1) manny:say_line("/nqma067/") manny:wait_for_actor() manny:play_chore(msb_reach_med, manny.base_costume) manny:stop_chore(msb_hold, manny.base_costume) sleep_for(750) manny:stop_chore(manny.hold_chore, manny.base_costume) nq.photo:put_in_limbo() manny:wait_for_chore() manny.is_holding = nil else manny:say_line("/nqma068/") end end nq.photo = Object:create(nq, "/nqtx020/lsa_photo", 0, 0, 0, { range = 0 }) nq.photo.wav = "getCard.wav" nq.photo.lookAt = function(arg1) -- line 786 manny:say_line("/nqma021/") end nq.photo.use = nq.photo.lookAt nq.photo.default_response = function(arg1) -- line 792 manny:say_line("/nqma069/") end nq.radio = Object:create(nq, "/nqtx022/radio", 0.12, 0.210196, 0.33000001, { range = 0.60000002 }) nq.radio.use_pnt_x = 0.320077 nq.radio.use_pnt_y = 0.25619501 nq.radio.use_pnt_z = 0 nq.radio.use_rot_x = 0 nq.radio.use_rot_y = -3127.02 nq.radio.use_rot_z = 0 nq.radio.lookAt = function(arg1) -- line 804 manny:say_line("/nqma023/") end nq.radio.pickUp = function(arg1) -- line 808 system.default_response("martialed") end nq.radio.use = function(arg1) -- line 812 if not arg1.tried then arg1.tried = TRUE manny:say_line("/nqma070/") wait_for_message() manny:say_line("/nqma024/") wait_for_message() salvador:say_line("/nqsa025/") wait_for_message() manny:say_line("/nqma026/") wait_for_message() olivia:say_line("/nqol027/") else manny:say_line("/nqma028/") wait_for_message() manny:say_line("/nqma029/") end end nq.memo = Object:create(nq, "/nqtx071/memo", 0.079999998, -0.28003299, 0.36000001, { range = 0.60000002 }) nq.memo.use_pnt_x = 0.28 nq.memo.use_pnt_y = -0.210033 nq.memo.use_pnt_z = 0 nq.memo.use_rot_x = 0 nq.memo.use_rot_y = 829.59497 nq.memo.use_rot_z = 0 nq.memo.lookAt = function(arg1) -- line 839 manny:say_line("/nqma072/") wait_for_message() manny:say_line("/nqma073/") wait_for_message() manny:say_line("/nqma074/") end nq.memo.pickUp = function(arg1) -- line 847 system.default_response("nah") end nq.memo.use = nq.memo.lookAt nq.remains = Object:create(nq, "/nqtx075/remains", 0.628353, -0.083236001, 0, { range = 0.60000002 }) nq.remains.use_pnt_x = 0.72854501 nq.remains.use_pnt_y = -0.23227701 nq.remains.use_pnt_z = 0 nq.remains.use_rot_x = 0 nq.remains.use_rot_y = -325.54999 nq.remains.use_rot_z = 0 nq.remains.lookAt = function(arg1) -- line 862 manny:say_line("/nqma076/") end nq.remains.pickUp = function(arg1) -- line 866 START_CUT_SCENE() if not nq.picked_up_arm then nq.picked_up_arm = TRUE preload_sfx("nqArmRip.wav") manny:walkto_object(arg1) manny:wait_for_actor() manny:play_chore(msb_reach_low, manny.base_costume) sleep_for(1000) start_sfx("nqArmRip.wav") arm_actor:free() nq.picked_up_arm = TRUE nq.arm:get() manny:stop_chore(msb_reach_low, manny.base_costume) if manny.fancy then manny:play_chore_looping(mcc_thunder_activate_hand, manny.base_costume) else manny:play_chore_looping(msb_activate_hand, "msb.cos") end manny:play_chore_looping(msb_hold, manny.base_costume) manny:wait_for_chore(msb_reach_low, manny.base_costume) manny.is_holding = nq.arm manny.hold_chore = msb_activate_hand manny:say_line("/nqma077/") else manny:say_line("/nqma078/") end END_CUT_SCENE() end nq.remains.use_hand = function(arg1) -- line 899 nq.wastebasket:use_hand() end nq.remains.use = nq.remains.pickUp nq.arm = Object:create(nq, "/nqtx079/arm", 0, 0, 0, { range = 0 }) nq.arm.string_name = "hand" nq.arm.wav = "getBone.wav" nq.arm.lookAt = function(arg1) -- line 910 manny:say_line("/nqma080/") end nq.arm.use = function(arg1) -- line 914 START_CUT_SCENE() manny:say_line("/nqma081/") if manny.fancy then manny:stop_chore(mcc_thunder_activate_hand, manny.base_costume) manny:stop_chore(mcc_thunder_hold, manny.base_costume) manny:run_chore(mcc_thunder_salute, manny.base_costume) manny:stop_chore(mcc_thunder_salute, manny.base_costume) manny:play_chore(mcc_thunder_activate_hand, manny.base_costume) manny:play_chore_looping(mcc_thunder_hold, manny.base_costume) else manny:stop_chore(msb_activate_hand, manny.base_costume) manny:stop_chore(msb_hold, manny.base_costume) manny:run_chore(msb_salute, manny.base_costume) manny:stop_chore(msb_salute, manny.base_costume) manny:play_chore(msb_activate_hand, manny.base_costume) manny:play_chore_looping(msb_hold, manny.base_costume) end END_CUT_SCENE() end nq.arm.default_response = function(arg1) -- line 935 manny:say_line("/nqma082/") end nq.tape_recorder = Object:create(nq, "/nqtx083/tape recorder", -0.76247901, -0.049222901, 0.30000001, { range = 0.60000002 }) nq.tape_recorder.use_pnt_x = -0.53847998 nq.tape_recorder.use_pnt_y = -0.025222899 nq.tape_recorder.use_pnt_z = 0 nq.tape_recorder.use_rot_x = 0 nq.tape_recorder.use_rot_y = 93.250999 nq.tape_recorder.use_rot_z = 0 nq.tape_recorder.lookAt = function(arg1) -- line 949 manny:say_line("/nqma084/") end nq.tape_recorder.pickUp = function(arg1) -- line 953 system.default_response("attached") end nq.tape_recorder.use = function(arg1) -- line 957 if manny:walkto_object(arg1) then START_CUT_SCENE() manny:play_chore(msb_hand_on_obj, manny.base_costume) manny:wait_for_chore() start_sfx("nqTapeOn.imu", 64) ImSetVoiceEffect("Intercom Filter") arg1:play_chore_looping(nq_tape_play) manny:play_chore(msb_hand_off_obj, manny.base_costume) sleep_for(500) bowlsley:say_line("/nqbl085/") sleep_for(2000) manny:twist_head_gesture() wait_for_message() hector:say_line("/nqhe086/") wait_for_message() hector:say_line("/nqhe087/") wait_for_message() bowlsley:say_line("/nqbl088/") manny:play_chore(msb_hand_on_obj, manny.base_costume) manny:wait_for_chore() arg1:stop_chore(nq_tape_play) arg1:play_chore(nq_take_stop) stop_sound("nqTapeOn.imu", 64) start_sfx("nqTapeOf.wav", 64) manny:play_chore(msb_hand_off_obj, manny.base_costume) manny:wait_for_chore() bowlsley:wait_for_message() ImSetVoiceEffect("OFF") END_CUT_SCENE() end end nq.eva_obj = Object:create(nq, "/nqtx089/Eva", -0.23578, -0.0184035, 0.42789999, { range = 0.60000002 }) nq.eva_obj.use_pnt_x = -0.52827197 nq.eva_obj.use_pnt_y = -0.22375099 nq.eva_obj.use_pnt_z = 0 nq.eva_obj.use_rot_x = 0 nq.eva_obj.use_rot_y = -56.860802 nq.eva_obj.use_rot_z = 0 nq.eva_obj.lookAt = function(arg1) -- line 1000 manny:say_line("/nqma090/") wait_for_message() eva:say_line("/nqev091/") end nq.eva_obj.pickUp = function(arg1) -- line 1006 if nq.meche_obj.touchable then manny:say_line("/nqma092/") else manny:say_line("/moma032/") end end nq.eva_obj.use = function(arg1) -- line 1015 START_CUT_SCENE() manny:say_line("/nqma093/") wait_for_message() eva:say_line("/nqev094/") wait_for_message() eva:say_line("/nqev095/") END_CUT_SCENE() end nq.eva_obj.use_lsa_photo = function(arg1) -- line 1025 eva:say_line("/nqev096/") end nq.eva_obj.use_hand = function(arg1) -- line 1029 START_CUT_SCENE() manny:walkto(-0.448578, -0.172294, 0, 0, 325.747, 0) manny:wait_for_actor() manny:say_line("/lrma008/") manny:use_default() END_CUT_SCENE() eva:say_line("/nqev097/") end nq.lw_door = Object:create(nq, "/nqtx030/exit", 0.97356099, 2.04339, 0.40000001, { range = 0.89999998 }) nq.lw_door.use_pnt_x = 0.68856102 nq.lw_door.use_pnt_y = 2.1083901 nq.lw_door.use_pnt_z = -0.050000001 nq.lw_door.use_rot_x = 0 nq.lw_door.use_rot_y = -74.121902 nq.lw_door.use_rot_z = 0 nq.lw_door.out_pnt_x = 0.93735403 nq.lw_door.out_pnt_y = 2.14853 nq.lw_door.out_pnt_z = -0.050000001 nq.lw_door.out_rot_x = 0 nq.lw_door.out_rot_y = -88.498001 nq.lw_door.out_rot_z = 0 nq.lw_door:make_untouchable() nq.lw_door.walkOut = function(arg1) -- line 1075 if nq.meche_obj.touchable then nq.the_plan() else lw:come_out_door(lw.nq_door) end end CheckFirstTime("su.lua") su = Set:create("su.set", "sunken lola", { su_chews = 0, su_ovrhd = 1 }) dofile("chepito.lua") dofile("mn_ctm.lua") dofile("mn_ctc.lua") su.chepito_to_manny = function(arg1) -- line 16 local local1 = manny:getpos() local local2 = chepito:getpos() while TurnActorTo(chepito.hActor, local1.x, local1.y, local1.z) do break_here() end chepito:head_look_at_manny() while TurnActorTo(manny.hActor, local2.x, local2.y, local2.z) do break_here() end end su.manny_to_chepito = function(arg1) -- line 62 local local1 = { } local local2, local3 local local4 = { x = 0.28582701, y = -0.142896, z = 0 } while 1 do local1 = chepito:getrot() local3 = RotateVector(local4, local1) local2 = chepito:getpos() local3.x = local3.x + local2.x local3.y = local3.y + local2.y local3.z = local3.z + local2.z chepito:setpos(manny:getpos()) chepito:setrot(manny:getrot()) break_here() end end su.chepito_proximity = function(arg1, arg2, arg3) -- line 83 local local1 = chepito:getpos() local local2 = sqrt((local1.x - arg1) ^ 2 + (local1.y - arg2) ^ 2 + (local1.z - arg3) ^ 2) return local2 end su.chepito_to_start = function() -- line 90 while TurnActorTo(chepito.hActor, chepito.start_position.x, chepito.start_position.y, chepito.start_position.z) do break_here() end while su.chepito_proximity(chepito.start_position.x, chepito.start_position.y, chepito.start_position.z) >= 0.05 do PointActorAt(chepito.hActor, chepito.start_position.x, chepito.start_position.y, chepito.start_position.z) chepito:walk_forward() break_here() end chepito:setpos(chepito.start_position.x, chepito.start_position.y, chepito.start_position.z) chepito:follow_boxes() end su.sink_aftermath = function(arg1) -- line 107 local local1 = 4.5 START_CUT_SCENE() set_override(su.sink_aftermath_override) manny:default("nautical") manny:put_in_set(su) manny:ignore_boxes() glottis:set_costume("glottis_sailor.cos") glottis:set_talk_color(Orange) glottis:set_visibility(TRUE) glottis:set_head(3, 4, 4, 165, 28, 80) glottis:set_mumble_chore(glottis_sailor_mumble) glottis:set_talk_chore(1, glottis_sailor_stop_talk) glottis:set_talk_chore(2, glottis_sailor_a) glottis:set_talk_chore(3, glottis_sailor_c) glottis:set_talk_chore(4, glottis_sailor_e) glottis:set_talk_chore(5, glottis_sailor_f) glottis:set_talk_chore(6, glottis_sailor_l) glottis:set_talk_chore(7, glottis_sailor_m) glottis:set_talk_chore(8, glottis_sailor_o) glottis:set_talk_chore(9, glottis_sailor_t) glottis:set_talk_chore(10, glottis_sailor_u) glottis:push_costume("gl_sailor_fastwalk.cos") glottis:head_look_at(nil) glottis:set_walk_chore(0, "gl_sailor_fastwalk.cos") glottis:set_walk_rate(0.5) glottis:put_in_set(su) manny:ignore_boxes() glottis:ignore_boxes() glottis:setpos(100, 100, 100) manny:setpos(100, 100, 100) start_sfx("current.imu", IM_HIGH_PRIORITY, 0) fade_sfx("current.imu", 2000, 80) manny:push_costume("mn_jump_sub.cos") glottis:push_costume("gl_jump_sub.cos") break_here() PreRender(TRUE, FALSE) manny:play_chore(0, "mn_jump_sub.cos") glottis:play_chore(0, "gl_jump_sub.cos") break_here() manny:follow_boxes() manny:setpos(-0.536861, -4.0693498, 0) manny:setrot(0, 227, 0) glottis:setpos(-0.120987, -3.50214, 0) glottis:setrot(0, 180, 0) glottis:follow_boxes() sleep_for(6400) fade_sfx("current.imu", 800) sleep_for(6000) manny:wait_for_chore(0, "mn_jump_sub.cos") manny:pop_costume() glottis:blend(glottis_sailor_home_pose, 0, 800, "glottis_sailor.cos", "gl_jump_sub.cos") sleep_for(800) glottis:pop_costume() PreRender(TRUE, TRUE) ForceRefresh() start_script(su.glottis_follow_manny) glottis:say_line("/sugl091/") wait_for_message() glottis:say_line("/sugl092/") wait_for_message() glottis:say_line("/sugl093/") wait_for_message() glottis:say_line("/sugl094/") wait_for_message() glottis:say_line("/sugl095/") wait_for_message() manny:say_line("/suma096/") wait_for_message() glottis:say_line("/sugl097/") wait_for_message() manny:say_line("/suma098/") wait_for_message() manny:say_line("/suma099/") wait_for_message() END_CUT_SCENE() glottis:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(glottis.hActor, 0.5) manny:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(chepito.hActor, 0.44999999) SetActorCollisionScale(manny.hActor, 0.34999999) kill_override() end su.sink_aftermath_override = function() -- line 202 kill_override() PreRender(TRUE, TRUE) ForceRefresh() manny:put_in_set(su) manny:default("nautical") manny:follow_boxes() manny:setpos(-0.536861, -4.06935, 0) manny:setrot(0, 227, 0) glottis:set_costume("glottis_sailor.cos") glottis:set_talk_color(Orange) glottis:set_visibility(TRUE) glottis:set_head(3, 4, 4, 165, 28, 80) glottis:set_mumble_chore(glottis_sailor_mumble) glottis:set_talk_chore(1, glottis_sailor_stop_talk) glottis:set_talk_chore(2, glottis_sailor_a) glottis:set_talk_chore(3, glottis_sailor_c) glottis:set_talk_chore(4, glottis_sailor_e) glottis:set_talk_chore(5, glottis_sailor_f) glottis:set_talk_chore(6, glottis_sailor_l) glottis:set_talk_chore(7, glottis_sailor_m) glottis:set_talk_chore(8, glottis_sailor_o) glottis:set_talk_chore(9, glottis_sailor_t) glottis:set_talk_chore(10, glottis_sailor_u) glottis:push_costume("gl_sailor_fastwalk.cos") glottis:head_look_at(nil) glottis:set_walk_chore(0, "gl_sailor_fastwalk.cos") glottis:set_walk_rate(0.5) glottis:put_in_set(su) glottis:setpos(-0.120987, -3.50214, 0) glottis:setrot(0, 180, 0) glottis:follow_boxes() glottis:play_chore(glottis_sailor_home_pose, "glottis_sailor.cos") glottis:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(glottis.hActor, 0.5) manny:set_collision_mode(COLLISION_SPHERE) SetActorCollisionScale(chepito.hActor, 0.45) SetActorCollisionScale(manny.hActor, 0.35) stop_sound("current.imu") start_script(su.glottis_follow_manny) end su.move_chepito_obj = function() -- line 249 local local1 = { } while 1 do local1 = chepito:getpos() su.moving_chepito_obj.interest_actor:setpos(local1.x, local1.y, local1.z + 0.40000001) if hot_object == su.moving_chepito_obj then manny:head_look_at(su.moving_chepito_obj) end break_here() end end su.chepito_sing = function(arg1, arg2) -- line 262 chepito.fade_cue = FALSE wait_for_message() chepito:say_line("/such100/") chepito:wait_for_message() chepito:say_line("/such101/") chepito:wait_for_message() chepito:say_line("/such102/") chepito:wait_for_message() chepito:say_line("/such103/") chepito:wait_for_message() chepito:say_line("/such104/") chepito:wait_for_message() chepito:say_line("/such105/") chepito.fade_cue = TRUE chepito:wait_for_message() chepito:say_line("/such107/") chepito:wait_for_message() chepito:say_line("/such108/") chepito:wait_for_message() chepito:say_line("/such109/") chepito:wait_for_message() chepito:say_line("/such110/") chepito:wait_for_message() chepito:say_line("/such111/") chepito:wait_for_message() chepito:say_line("/such112/") chepito:wait_for_message() chepito:say_line("/such113/") chepito:wait_for_message() if arg2 then start_script(su.glottis_sing) glottis:set_speech_mode(MODE_BACKGROUND) end chepito:say_line("/such121/") chepito:wait_for_message() chepito:say_line("/such122/") chepito:wait_for_message() chepito:say_line("/such123/") chepito:wait_for_message() chepito:say_line("/such125/") chepito:wait_for_message() chepito:say_line("/such126/") chepito:wait_for_message() chepito:say_line("/such127/") chepito:wait_for_message() sleep_for(3000) chepito:say_line("/such114/") chepito:wait_for_message() chepito:say_line("/such116/") chepito:wait_for_message() chepito:say_line("/such117/") chepito:wait_for_message() chepito:say_line("/such118/") chepito:wait_for_message() chepito:say_line("/such120/") end su.glottis_sing = function() -- line 334 glottis:say_line("/sugl128/") glottis:wait_for_message() glottis:say_line("/sugl129/") glottis:wait_for_message() glottis:say_line("/sugl130/") glottis:wait_for_message() glottis:say_line("/sugl131/") glottis:wait_for_message() glottis:say_line("/sugl132/") glottis:wait_for_message() glottis:say_line("/sugl133/") glottis:wait_for_message() glottis:say_line("/sugl134/") end su.chepito_orbit = function() -- line 350 while 1 do su.glottis_look_chepito = TRUE if not chepito.seen then start_sfx("rfPigMus.imu") chepito.seen = TRUE glottis:say_line("/sugl135/") wait_for_message() glottis:say_line("/sugl136/") end local local1 = 0 if not chepito.just_talked then chepito.just_talked = FALSE repeat local1 = local1 + PerSecond(0.30000001) if local1 > 1 then local1 = 1 end SetLightIntensity("chepito_light", local1) break_here() until local1 == 1 end chepito:walkto(3.8, -5.4790602, 0) while not chepito:find_sector_name("chepito_visible") and chepito:is_moving() do break_here() end if sound_playing("rfPigMus.imu") then fade_sfx("rfPigMus.imu") end su.moving_chepito_obj:make_touchable() while chepito:find_sector_name("chepito_visible") do break_here() end local local2 = 1 local local3 = 127 repeat local2 = local2 - PerSecond(0.33000001) local3 = local3 - PerSecond(42) if local2 < 0 then local2 = 0 end SetLightIntensity("chepito_light", local2) chepito.saylineTable.vol = local3 break_here() until local2 == 0 su.glottis_look_chepito = FALSE su.moving_chepito_obj:make_untouchable() stop_script(su.chepito_sing) chepito.saylineTable.vol = nil su.chepito_mad = FALSE wait_for_message() if not chepito.met and not su.talked_spooky then su.talked_spooky = TRUE glottis:say_line("/sugl137/") end chepito:wait_for_actor() sleep_for(5000) chepito:setpos(7.8699999, 3.7, 0) chepito:walkto(3.0699999, 9.3500004, 0) chepito:wait_for_actor() chepito:setpos(-9.8000002, 39, 3) chepito:walkto(-26.799999, 38, 3) chepito:wait_for_actor() sleep_for(5000) chepito:default() chepito.knows_manny = FALSE chepito.just_talked = FALSE chepito:setpos({ x = -2.66886, y = -5.3533502, z = 0 }) chepito:setrot(0, 448.375, 0) end end su.chepito_light = function(arg1) -- line 433 local local1 = { } local local2, local3, local4 while 1 do if GetActorRect(chepito.hActor) ~= nil then local2, local3, local4 = GetActorNodeLocation(chepito.hActor, 12) SetLightPosition("chepito_light", local2, local3, local4) else local1 = chepito:getpos() SetLightPosition("chepito_light", local1.x, local1.y, local1.z + 0.5) end break_here() end end su.stop_chepito = function(arg1) -- line 448 if su.chepito_mad then manny:say_line("/suma138/") wait_for_message() chepito:say_line("/such139/") elseif find_script(su.dangle_bait) then stop_script(su.dangle_bait) stop_script(su.chepito_sing) su.lantern:make_untouchable() manny:say_line("/suma140/") Dialog:run("cp1", "dlg_chepito.lua") else manny:say_line("/suma141/") if proximity(manny, chepito) < 1.5 then stop_script(su.chepito_orbit) stop_script(su.move_chepito_obj) chepito:stop_walk() Dialog:run("cp1", "dlg_chepito.lua") else wait_for_message() manny:say_line("/suma142/") end end end su.dangle_bait = function() -- line 477 local local1, local2, local3 chepito:set_collision_mode(COLLISION_OFF) manny:set_collision_mode(COLLISION_OFF) start_script(su.chepito_sing) chepito:walkto(0.77413899, -3.7153499, 0, 0, 135.5, 0) chepito:wait_for_actor() local local4 = 0 stop_script(su.glottis_follow_manny) local1, local2, local3 = GetActorNodeLocation(chepito.hActor, 12) su.lantern:make_touchable() su.lantern.interest_actor:setpos(local1, local2, local3) su.moving_chepito_obj:make_untouchable() repeat glottis:head_look_at(chepito) chepito:play_chore(cheptio_2conv) sleep_for(2000) glottis:head_look_at_manny() chepito:play_chore(cheptio_2base) sleep_for(2000) local4 = local4 + 1 until local4 == 3 su.lantern:make_untouchable() chepito:walkto(1.31036, -5.4790602, 0) single_start_script(su.chepito_orbit) single_start_script(su.move_chepito_obj) single_start_script(su.glottis_follow_manny) end su.cpos = { } su.crot = { } su.grab_lantern = function() -- line 513 local local1 = { } local local2 START_CUT_SCENE() manny:walkto(0.44378, -3.6732299, 0, 0, -160.394, 0) manny:wait_for_actor() while chepito:is_moving() do break_here() end local local3 = start_script(su.glottis_to_manny) stop_script(su.dangle_bait) stop_script(su.chepito_sing) manny:push_costume("mn_ctm.cos") manny:play_chore(mn_ctm_grabs_ct) local1 = manny:getpos() local2 = manny:getrot() su.cpos = chepito:getpos() su.crot = chepito:getrot() chepito:setpos(local1) chepito:setrot(local2) chepito:push_costume("mn_ctc.cos") chepito:play_chore(mn_ctm_grabs_ct) manny:wait_for_chore() chepito:wait_for_chore() manny:stop_chore(mn_ctm_grabs_ct) chepito:stop_chore(mn_ctm_grabs_ct) manny:play_chore_looping(mn_ctm_hold_ct) chepito:play_chore_looping(mn_ctm_hold_ct) wait_for_script(local3) start_script(manny_head_look_at_glottis) su.lantern:make_untouchable() END_CUT_SCENE() lantern_save_handler = system.buttonHandler system.buttonHandler = suButtonHandler chepito:say_line("/such143/") wait_for_message() chepito:say_line("/such144/") wait_for_message() chepito:say_line("/such145/") wait_for_message() chepito:say_line("/such146/") wait_for_message() START_CUT_SCENE() su.moving_chepito_obj:make_untouchable() su.lantern:make_untouchable() chepito:set_chore_looping(mn_ctc_hold_ct, FALSE) manny:set_chore_looping(mn_ctm_hold_ct, FALSE) chepito:wait_for_chore() chepito:play_chore(mn_ctc_ct_struggle) manny:play_chore(mn_ctc_ct_struggle) chepito:wait_for_chore() chepito:setpos(su.cpos) chepito:setrot(su.crot) chepito:pop_costume() chepito:play_chore(chepito_break_free) sleep_for(900) manny:stop_chore(mn_ctc_ct_struggle) chepito:wait_for_chore() manny:pop_costume() if not su.tried_grab then su.tried_grab = TRUE chepito:say_line("/such147/") else chepito:say_line("/such148/") end wait_for_message() su.chepito_mad = TRUE chepito:walkto(1.31036, -5.4790602, 0) single_start_script(su.chepito_orbit) single_start_script(su.move_chepito_obj) chepito:say_line("/such149/") system.buttonHandler = lantern_save_handler END_CUT_SCENE() end su.give_chepito_to_glottis = function() -- line 598 START_CUT_SCENE() stop_script(su.grab_lantern) stop_script(su.glottis_follow_manny) glottis:head_look_at(nil) glottis:stop_chore(glottis_sailor_home_pose, "glottis_sailor.cos") glottis:push_costume("gl_grab_ct.cos") manny:set_chore_looping(mn_ctm_hold_ct, FALSE) chepito:set_chore_looping(mn_ctm_hold_ct, FALSE) manny:wait_for_chore() manny:stop_chore(mn_ctm_hold_ct) chepito:stop_chore(mn_ctm_hold_ct) manny:play_chore(mn_ctm_handoff_ct) chepito:play_chore(mn_ctm_handoff_ct) glottis:play_chore(0) chepito:say_line("/such172/") manny:wait_for_chore() manny:pop_costume() chepito:free() glottis:wait_for_chore() glottis:say_line("/sugl173/") wait_for_message() manny:say_line("/suma174/") MakeSectorActive("uber_sektor", TRUE) start_script(manny.walkto, manny, -3.52772, 0.790292, 0) wait_for_message() PreRender(TRUE, FALSE) glottis:set_walk_chore(2, "gl_grab_ct.cos") glottis:set_rest_chore(1, "gl_grab_ct.cos") start_script(glottis.walkto, glottis, -3.52772, 0.790292, 0) chepito:say_line("/such175/") wait_for_message() manny:say_line("/suma176/") wait_for_message() IrisDown(200, 345, 1000) sleep_for(1000) END_CUT_SCENE() system.buttonHandler = lantern_save_handler PreRender(TRUE, TRUE) start_script(cut_scene.thepearl) end su.turn_right = function() -- line 643 START_CUT_SCENE() stop_script(su.grab_lantern) chepito:set_chore_looping(mn_ctc_hold_ct, FALSE) manny:set_chore_looping(mn_ctm_hold_ct, FALSE) chepito:wait_for_chore() chepito:play_chore(mn_ctc_ct_struggle) manny:play_chore(mn_ctc_ct_struggle) chepito:wait_for_chore() chepito:setpos(0.44378, -3.67323, 0) chepito:setrot(0, -160.394, 0) chepito:pop_costume() chepito:play_chore(chepito_break_free) sleep_for(900) manny:stop_chore(mn_ctc_ct_struggle) chepito:wait_for_chore() chepito:stop_chore(chepito_break_free) chepito:setpos(0.754139, -3.71535, 0) chepito:setrot(0, 150.5, 0) manny:pop_costume() if not su.tried_grab then su.tried_grab = TRUE chepito:say_line("/such147/") else chepito:say_line("/such148/") end wait_for_message() su.chepito_mad = TRUE chepito:walkto(1.31036, -5.47906, 0) single_start_script(su.chepito_orbit) single_start_script(su.move_chepito_obj) chepito:say_line("/such149/") system.buttonHandler = lantern_save_handler END_CUT_SCENE() end su.set_up_actors = function(arg1) -- line 685 chepito:default() chepito:put_in_set(su) chepito:follow_boxes() chepito:setpos({ x = -2.66886, y = -5.35335, z = 0 }) chepito:setrot(0, 448.375, 0) chepito:set_rest_chore(chepito_base) chepito.start_position = { } end suButtonHandler = function(arg1, arg2, arg3) -- line 696 if arg1 == EKEY and controlKeyDown and arg2 then start_script(execute_user_command) bHandled = TRUE elseif control_map.TURN_RIGHT[arg1] and arg2 and cutSceneLevel <= 0 then start_script(su.give_chepito_to_glottis) elseif control_map.TURN_LEFT[arg1] and arg2 and cutSceneLevel <= 0 then start_script(su.give_chepito_to_glottis) else CommonButtonHandler(arg1, arg2, arg3) end end manny_head_look_at_glottis = function() -- line 710 local local1 = { } local1 = glottis:getpos() manny:head_look_at(local1.x, local1.y, local1.z + 1.2) end su.glottis_to_manny = function(arg1) -- line 717 local local1 = { } local local2, local3 local local4 = { x = 0.80189598, y = 0.00076497701, z = 0 } local1 = manny:getrot() local3 = RotateVector(local4, local1) local2 = manny:getpos() local3.x = local3.x + local2.x local3.y = local3.y + local2.y local3.z = local3.z + local2.z glottis:setrot(0, 190, 0) end su.glottis_follow_manny = function(arg1) -- line 736 local local1 = { } while 1 do if su.glottis_look_chepito then glottis:head_look_at(chepito) else glottis:head_look_at_manny() end break_here() end end su.test = function() -- line 754 chepito:default() chepito:ignore_boxes() manny:push_costume("chepito.cos") glottis:push_costume("mn_ctc.cos") chepito:play_chore_looping(chepito_break_free) while 1 do break_here() end manny:play_chore(2) chepito:play_chore(chepito_grabs) manny:wait_for_chore() manny:stop_chore(2) manny:play_chore(3) manny:wait_for_chore() manny:stop_chore(3) manny:play_chore(4) manny:wait_for_chore() manny:stop_chore(4) manny:play_chore(5) manny:wait_for_chore() manny:stop_chore(5) chepito:wait_for_chore() end su.enter = function(arg1) -- line 796 su:set_up_actors() manny:put_in_set(su) manny:follow_boxes() MakeSectorActive("uber_sektor", FALSE) manny:setpos(-0.0379301, -3.35008, 0) manny:setrot(0, 176.765, 0) start_script(su.sink_aftermath) SetLightPosition("chepito_light", -0.326861, -5.15835, 0.564) SetLightIntensity("chepito_light", 0) su:add_ambient_sfx(underwater_ambience_list, underwater_ambience_parm_list) end su.exit = function(arg1) -- line 812 chepito:free() stop_sound("bubvox.imu") stop_script(su.chepito_orbit) stop_script(su.move_chepito_obj) stop_script(su.chepito_light) stop_script(su.glottis_follow_manny) end su.ring1 = { } su.ring1.walkOut = function(arg1) -- line 827 START_CUT_SCENE("no head") MakeSectorActive("ring1", FALSE) MakeSectorActive("ring2", FALSE) MakeSectorActive("ring3", FALSE) MakeSectorActive("ring4", FALSE) MakeSectorActive("ring5", FALSE) MakeSectorActive("ring6", FALSE) MakeSectorActive("ring7", FALSE) MakeSectorActive("ring8", FALSE) MakeSectorActive("ring9", FALSE) MakeSectorActive("ring10", FALSE) glottis:say_line("/sugl150/") wait_for_message() manny:head_look_at(glottis) glottis:say_line("/sugl151/") wait_for_message() glottis:say_line("/sugl152/") wait_for_message() glottis:say_line("/sugl153/") wait_for_message() manny:head_look_at(nil) manny:shrug_gesture() manny:say_line("/suma154/") wait_for_message() manny:say_line("/suma155/") END_CUT_SCENE() enable_head_control(TRUE) sleep_for(5000) single_start_script(su.chepito_orbit) single_start_script(su.move_chepito_obj) end su.ring2 = su.ring1 su.ring3 = su.ring1 su.ring4 = su.ring1 su.ring5 = su.ring1 su.ring6 = su.ring1 su.ring7 = su.ring1 su.ring8 = su.ring1 su.ring9 = su.ring1 su.ring10 = su.ring1 su.lantern = Object:create(su, "/sutx156/lantern", 0, 0, 0, { range = 2 }) su.lantern:make_untouchable() su.lantern.immediate = TRUE su.lantern.lookAt = function(arg1) -- line 879 manny:say_line("/suma157/") end su.lantern.pickUp = function(arg1) -- line 883 start_script(su.grab_lantern) end su.lantern.use = su.lantern.pickUp su.moving_chepito_obj = Object:create(su, "/sutx158/Chepito", 0, 0, 0, { range = 1.5 }) su.moving_chepito_obj.immediate = TRUE su.moving_chepito_obj:make_untouchable() su.moving_chepito_obj.lookAt = function(arg1) -- line 894 manny:say_line("/suma159/") end su.moving_chepito_obj.use = function(arg1) -- line 898 if find_script(su.dangle_bait) then su.lantern:pickUp() else start_script(su.stop_chepito) end end su.sunken_lola = Object:create(su, "/sutx160/Lola", 0.151732, -3.0110099, 1.63, { range = 1.7 }) su.sunken_lola.use_pnt_x = 0.33173099 su.sunken_lola.use_pnt_y = -3.0310099 su.sunken_lola.use_pnt_z = 0 su.sunken_lola.use_rot_x = 0 su.sunken_lola.use_rot_y = 4.5426698 su.sunken_lola.use_rot_z = 0 su.sunken_lola.lookAt = function(arg1) -- line 915 manny:say_line("/suma161/") end su.sunken_lola.pickUp = function(arg1) -- line 919 system.default_response("underwater") end su.sunken_lola.use = function(arg1) -- line 923 manny:say_line("/suma162/") if not arg1.seen then arg1.seen = TRUE wait_for_message() glottis:say_line("/sugl163/") wait_for_message() manny:say_line("/suma164/") wait_for_message() glottis:say_line("/sugl165/") end end su.glottis_obj = Object:create(su, "/sutx166/Glottis", -0.162861, -3.8013501, 0.759, { range = 1 }) su.glottis_obj.use_pnt_x = -0.403806 su.glottis_obj.use_pnt_y = -3.8994901 su.glottis_obj.use_pnt_z = 0 su.glottis_obj.use_rot_x = 0 su.glottis_obj.use_rot_y = 51.2481 su.glottis_obj.use_rot_z = 0 su.glottis_obj.lookAt = function(arg1) -- line 944 manny:say_line("/suma167/") end su.glottis_obj.pickUp = su.sunken_lola.pickUp su.glottis_obj.use = function(arg1) -- line 950 START_CUT_SCENE() manny:say_line("/suma168/") wait_for_message() glottis:say_line("/sugl169/") wait_for_message() glottis:say_line("/sugl170/") wait_for_message() manny:say_line("/suma171/") END_CUT_SCENE() end su.pearl = Object:create(su, "/sutx177/light", -6.7880802, 8.1357002, 1.08, { range = 13.3 }) su.pearl.use_pnt_x = -1.75808 su.pearl.use_pnt_y = -3.5142901 su.pearl.use_pnt_z = 0 su.pearl.use_rot_x = 0 su.pearl.use_rot_y = 45.6399 su.pearl.use_rot_z = 0 su.pearl.lookAt = function(arg1) -- line 972 manny:say_line("/suma178/") wait_for_message() manny:say_line("/suma179/") end su.pearl.use = function(arg1) -- line 978 manny:say_line("/suma180/") end su.pearl.pickUp = su.pearl.use glottis_sailor_trans_rock = 0 glottis_sailor_ear_wax = 1 glottis_sailor_trans_home = 2 glottis_sailor_smart_ass = 3 glottis_sailor_rock_loop = 4 glottis_sailor_look_down = 5 glottis_sailor_home_pose = 6 glottis_sailor_flip_ears = 7 glottis_sailor_mumble = 8 glottis_sailor_c = 9 glottis_sailor_f = 10 glottis_sailor_e = 11 glottis_sailor_u = 12 glottis_sailor_t = 13 glottis_sailor_m = 14 glottis_sailor_a = 15 glottis_sailor_o = 16 glottis_sailor_stop_talk = 17 CheckFirstTime("tb.lua") dofile("doug_idles.lua") dofile("ma_photopass.lua") tb = Set:create("tb.set", "track betting", { tb_fotws = 1, tb_strws = 0, tb_strws2 = 0, tb_strws3 = 0, tb_strws4 = 0, tb_overhead = 2 }) tb.show_room = function(arg1) -- line 17 START_CUT_SCENE() cameraman_disabled = FALSE manny:walkto(-0.619026, -0.0328044, 0, 0, 272.47, 0) manny:wait_for_actor() manny:head_look_at_point({ x = 1.84646, y = -0.367253, z = 0.595 }) manny:say_line("/lyma009/") manny:point_gesture() manny:wait_for_message() manny:walkto(0.723649, -0.690082, 0, 0, 306.381, 0) while point_proximity(0.723649, -0.690082, 0) > 0.4 do break_here() end tw:switch_to_set() manny:head_look_at(nil) manny:put_in_set(tw) manny:setpos(0.938004, -0.50864, 0) manny:setrot(0, 309.019, 0) manny:head_look_at(tw.track) manny:walkto(tw.track) manny:wait_for_actor() tw.track:lookAt() manny:head_look_at(nil) END_CUT_SCENE() end tb.crowd_cheer = function(arg1) -- line 43 local local1 if arg1 or rndint(100) < 40 then local1 = pick_one_of({ "tkCheer1.wav", "tkCheer2.wav", "tkCheer3.wav", "tkCheer4.wav" }) if system.currentSet == tb then vol = 65 elseif system.currentSet == tw then vol = 65 elseif system.currentSet == ts then vol = 80 elseif system.currentSet == ks then vol = 30 elseif system.currentSet == kh then vol = 40 else vol = 0 end if vol > 0 then start_sfx(local1, IM_LOW_PRIORITY, vol) set_pan(local1, rndint(30, 100)) end end end tb.off_screen_kittys = function() -- line 71 local local1 local local2 while 1 do sleep_for(rnd(6000, 12000)) if not cat_race_running then local1 = pick_one_of({ "kitty1.wav", "kitty2.wav", "kitty3.wav", "kitty4.wav", "kitty5.wav" }) if system.currentSet == tb then local2 = 30 elseif system.currentSet == tw then local2 = 30 elseif system.currentSet == ts then local2 = 35 elseif system.currentSet == ks then local2 = 45 elseif system.currentSet == kh then local2 = 55 else local2 = 0 end if local2 > 0 then start_sfx(local1, IM_LOW_PRIORITY, local2) if rnd() then set_pan(local1, 127) else set_pan(local1, 1) end end end break_here() end end tb.init_cat_names = function() -- line 106 local local1 = 0 cat_names = { } repeat local1 = local1 + 1 cat_names[local1] = { name = nil, racing = nil, odds = 3 } until local1 == 60 cat_names[1].name = "/tbta066/" cat_names[2].name = "/tbta067/" cat_names[3].name = "/tbta068/" cat_names[4].name = "/tbta069/" cat_names[5].name = "/tbta070/" cat_names[6].name = "/tbta071/" cat_names[7].name = "/tbta072/" cat_names[8].name = "/tbta073/" cat_names[9].name = "/tbta074/" cat_names[10].name = "/tbta075/" cat_names[11].name = "/tbta076/" cat_names[12].name = "/tbta077/" cat_names[13].name = "/tbta078/" cat_names[14].name = "/tbta079/" cat_names[15].name = "/tbta080/" cat_names[16].name = "/tbta081/" cat_names[17].name = "/tbta082/" cat_names[18].name = "/tbta083/" cat_names[19].name = "/tbta084/" cat_names[20].name = "/tbta085/" cat_names[21].name = "/tbta086/" cat_names[22].name = "/tbta087/" cat_names[23].name = "/tbta088/" cat_names[24].name = "/tbta089/" cat_names[25].name = "/tbta090/" cat_names[26].name = "/tbta091/" cat_names[27].name = "/tbta092/" cat_names[28].name = "/tbta093/" cat_names[29].name = "/tbta094/" cat_names[30].name = "/tbta095/" cat_names[31].name = "/tbta096/" cat_names[32].name = "/tbta097/" cat_names[33].name = "/tbta098/" cat_names[34].name = "/tbta099/" cat_names[35].name = "/tbta100/" cat_names[36].name = "/tbta101/" cat_names[37].name = "/tbta102/" cat_names[38].name = "/tbta103/" cat_names[39].name = "/tbta104/" cat_names[40].name = "/tbta105/" cat_names[41].name = "/tbta106/" cat_names[42].name = "/tbta107/" cat_names[43].name = "/tbta108/" cat_names[44].name = "/tbta109/" cat_names[45].name = "/tbta110/" cat_names[46].name = "/tbta111/" cat_names[47].name = "/tbta112/" cat_names[48].name = "/tbta113/" cat_names[49].name = "/tbta114/" cat_names[50].name = "/tbta115/" cat_names[51].name = "/tbta116/" cat_names[52].name = "/tbta117/" cat_names[53].name = "/tbta118/" cat_names[54].name = "/tbta119/" cat_names[55].name = "/tbta120/" cat_names[56].name = "/tbta121/" cat_names[57].name = "/tbta122/" cat_names[58].name = "/tbta123/" cat_names[59].name = "/tbta124/" cat_names[60].name = "/tbta125/" local1 = 0 cat_announcements = { } repeat local1 = local1 + 1 cat_announcements[local1] = { say = nil, place = nil } until local1 == 44 cat_announcements[1].say = "/tbta126/" cat_announcements[2].say = "/tbta127/" cat_announcements[3].say = "/tbta128/" cat_announcements[4].say = "/tbta129/" cat_announcements[5].say = "/tbta130/" cat_announcements[6].say = "/tbta131/" cat_announcements[7].say = "/tbta132/" cat_announcements[8].say = "/tbta133/" cat_announcements[9].say = "/tbta134/" cat_announcements[10].say = "/tbta135/" cat_announcements[11].say = "/tbta136/" cat_announcements[12].say = "/tbta137/" cat_announcements[13].say = "/tbta142/" cat_announcements[14].say = "/tbta143/" cat_announcements[15].say = "/tbta144/" cat_announcements[15].place = 1 cat_announcements[16].say = "/tbta145/" cat_announcements[16].place = -8 cat_announcements[17].say = "/tbta146/" cat_announcements[17].place = 3 cat_announcements[18].say = "/tbta147/" cat_announcements[18].place = 1 cat_announcements[19].say = "/tbta148/" cat_announcements[19].place = 2 cat_announcements[20].say = "/tbta149/" cat_announcements[20].place = 3 cat_announcements[21].say = "/tbta150/" cat_announcements[21].place = -5 cat_announcements[22].say = "/tbta151/" cat_announcements[22].place = -3 cat_announcements[23].say = "/tbta152/" cat_announcements[23].place = -1 cat_announcements[24].say = "/tbta153/" cat_announcements[24].place = 2 cat_announcements[25].say = "/tbta154/" cat_announcements[25].place = -1 cat_announcements[26].say = "/tbta155/" cat_announcements[26].place = -8 cat_announcements[27].say = "/tbta156/" cat_announcements[27].place = -8 cat_announcements[28].say = "/tbta157/" cat_announcements[28].place = -8 cat_announcements[29].say = "/tbta158/" cat_announcements[29].place = nil cat_announcements[30].say = "/tbta159/" cat_announcements[30].place = nil cat_announcements[31].say = "/tbta160/" cat_announcements[31].place = 97 cat_announcements[32].say = "/tbta161/" cat_announcements[32].place = 98 cat_announcements[33].say = "/tbta162/" cat_announcements[33].place = 3 cat_announcements[34].say = "/tbta163/" cat_announcements[34].place = -1 cat_announcements[35].say = "/tbta164/" cat_announcements[35].place = 1 cat_announcements[36].say = "/tbta165/" cat_announcements[36].place = 2 cat_announcements[37].say = "/tbta166/" cat_announcements[37].place = 3 cat_announcements[38].say = "/tbta167/" cat_announcements[38].place = -1 cat_announcements[39].say = "/tbta170/" cat_announcements[39].place = -2 cat_announcements[40].say = "/tbta171/" cat_announcements[40].place = 3 cat_announcements[41].say = "/tbta172/" cat_announcements[41].place = -1 cat_announcements[42].say = "/tbta173/" cat_announcements[42].place = -1 end time_announcements = { } time_announcements[1] = "/tbta138/" time_announcements[2] = "/tbta139/" time_announcements[3] = "/tbta140/" time_announcements[4] = "/tbta141/" tb.NUMBER_OF_CATS = 8 track_announcer = Actor:create(nil, nil, nil, "announcer") track_announcer.say_line = function(arg1, arg2) -- line 265 local local1 if system.currentSet == tb or system.currentSet == hh or system.currentSet == ts or system.currentSet == tw then arg1.sfx_boy = nil Actor.say_line(arg1, arg2, { background = TRUE, volume = announcer_volume, skip_log = TRUE }) elseif system.currentSet == hl then arg2 = strsub(arg2, 2) local1 = strlen(arg2) arg2 = strsub(arg2, 1, local1 - 1) arg2 = arg2 .. ".wav" arg1.sfx_boy = start_sfx(arg2, IM_LOW_PRIORITY, announcer_volume) end end track_announcer.wait_for_message = function(arg1) -- line 280 if arg1.sfx_boy then wait_for_sound(arg1.sfx_boy) else while IsMessageGoing(arg1.hActor) do break_here() end end end start_cat_sfx = function(arg1, arg2) -- line 291 start_sfx(arg1) set_pan(arg1, 10) if system.currentSet == tb or system.currentSet == tw then set_vol(arg1, 100) elseif system.currentSet == ts then set_vol(arg1, 64) elseif system.currentSet == hl then set_vol(arg1, 20) else stop_sound(arg1) end if not arg2 then fade_pan_sfx(arg1, 1800, 100) end end announcer_volume_setting = function() -- line 309 while 1 do if system.currentSet == tb then announcer_volume = 90 elseif system.currentSet == tw then announcer_volume = 115 elseif system.currentSet == ts then announcer_volume = 127 elseif system.currentSet == hl or system.currentSet == hh then announcer_volume = 64 end break_here() end end tb.cat_paws = function() -- line 325 local local1 = system.currentSet local local2 = 0 while cat_race_running do if system.currentSet == tb or system.currentSet == tw then local2 = 35 elseif system.currentSet == ts then local2 = 25 elseif system.currentSet == hl then local2 = 14 else if local2 > 0 then fade_sfx("twRaceLp.IMU", 300, 0) end local2 = 0 end if local2 > 0 then single_start_sfx("twRaceLp.IMU") set_vol("twRaceLp.imu", local2) end repeat break_here() until local1 ~= system.current_set local1 = system.currentSet end fade_sfx("twRaceLp.IMU", 500, 0) end tb.pre_race_timer = function() -- line 358 local local1 = 0 repeat local1 = local1 + 1 tb.race_countdown_announcement = time_announcements[local1] sleep_for(60000) until local1 == 4 end tb.init_cat_race = function() -- line 367 local local1 = 0 local local2 local local3, local4 local local5 local local6 cat_racers = { } repeat local1 = local1 + 1 cat_racers[local1] = { name = nil, distance = 0, number = nil, odds = nil } until local1 == tb.NUMBER_OF_CATS local1 = 0 repeat local1 = local1 + 1 cat_names[local1].racing = nil until local1 == 60 local1 = 0 repeat local1 = local1 + 1 repeat local2 = rndint(1, 60) if not cat_names[local2].racing then cat_names[local2].racing = TRUE cat_racers[local1].name = cat_names[local2].name cat_racers[local1].distance = 1 cat_racers[local1].number = local2 cat_racers[local1].odds = cat_names[local2].odds end until cat_racers[local1].name until local1 == tb.NUMBER_OF_CATS end tb.cat_race_simulator = function() -- line 404 local local1 = 0 local local2 local local3, local4 local local5 local local6 local local7, local8 tb.miracle = FALSE calculate_cats = TRUE cat_race_running = TRUE while cat_race_running do if calculate_cats then local1 = 0 repeat local1 = local1 + 1 cat_racers[local1].distance = cat_racers[local1].distance + rnd(1, 5) + cat_racers[local1].odds until local1 == tb.NUMBER_OF_CATS local7 = rnd(1, 100) local8 = rnd(1, 100) if not tb.miracle and local7 == local8 then tb.miracle = TRUE cat_racers[tb.NUMBER_OF_CATS].distance = 1000000 miracle_cat = cat_racers[tb.NUMBER_OF_CATS].name end local1 = 0 repeat local1 = local1 + 1 local3 = local1 local4 = local3 + 1 while cat_racers[local4] do if cat_racers[local3].distance < cat_racers[local4].distance then local5 = cat_racers[local3].name local6 = cat_racers[local3].distance cat_racers[local3].name = cat_racers[local4].name cat_racers[local3].distnce = cat_racers[local4].distance cat_racers[local4].name = local5 cat_racers[local4].distnce = local6 end local3 = local3 + 1 local4 = local3 + 1 end until local1 == tb.NUMBER_OF_CATS end break_here() end end tb.track_announcer = function() -- line 456 local local1 local local2 = 1 local local3, local4 local local5 local local6 = FALSE while 1 do local2 = 1 cat_race_running = FALSE local local7 = start_script(tb.pre_race_timer) while find_script(local7) do if tb.race_countdown_announcement then track_announcer:say_line(tb.race_countdown_announcement) tb.race_countdown_announcement = nil else track_announcer:say_line(cat_announcements[local2].say) local2 = local2 + 1 if local2 == 13 then local2 = 1 end end track_announcer:wait_for_message() sleep_for(20000) end track_announcer:say_line(cat_announcements[13].say) track_announcer:wait_for_message() tb.init_cat_race() local2 = 0 track_announcer:say_line("/tbta164/") repeat local2 = local2 + 1 track_announcer:wait_for_message() track_announcer:say_line(cat_racers[local2].name) track_announcer:wait_for_message() until local2 == tb.NUMBER_OF_CATS local local8 = start_script(tb.cat_race_simulator) sleep_for(2000) start_cat_sfx("kittyBel.wav", TRUE) sleep_for(500) track_announcer:say_line(cat_announcements[14].say) tb.crowd_cheer(TRUE) single_start_script(tb.cat_paws) track_announcer:wait_for_message() local6 = FALSE local2 = 14 repeat calculate_cats = FALSE local2 = local2 + 1 if cat_announcements[local2].place then if tb.miracle and not local6 then local6 = TRUE local2 = local2 - 1 track_announcer:say_line(miracle_cat) track_announcer:wait_for_message() track_announcer:say_line("/tbta168/") track_announcer:wait_for_message() track_announcer:say_line("/tbta169/") track_announcer:wait_for_message() tb.crowd_cheer(TRUE) elseif cat_announcements[local2].place == 99 then local3 = cat_racers[1] local4 = cat_racers[2] track_announcer:say_line(local3.name) track_announcer:wait_for_message() track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() track_announcer:say_line(local4.name) track_announcer:wait_for_message() elseif cat_announcements[local2].place == 98 then local3 = cat_racers[1] local4 = cat_racers[2] track_announcer:say_line(local4.name) track_announcer:wait_for_message() track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() track_announcer:say_line(local3.name) track_announcer:wait_for_message() elseif cat_announcements[local2].place == 97 then local3 = cat_racers[1] local4 = cat_racers[2] track_announcer:say_line(local3.name) track_announcer:wait_for_message() track_announcer:say_line(local4.name) track_announcer:wait_for_message() track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() elseif cat_announcements[local2].place < 0 then local5 = abs(cat_announcements[local2].place) local3 = cat_racers[local5] track_announcer:say_line(local3.name) track_announcer:wait_for_message() track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() else local5 = abs(cat_announcements[local2].place) local3 = cat_racers[local5] track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() track_announcer:say_line(local3.name) track_announcer:wait_for_message() end else track_announcer:say_line(cat_announcements[local2].say) track_announcer:wait_for_message() end tb.crowd_cheer() if local2 == 35 or local2 == 36 or local2 == 37 or local2 == 41 or local2 == 42 then if local2 == 35 then start_cat_sfx("twCatBy.wav") if system.currentSet == tw then StartMovie("tb_kitty.snm", nil, 168, 398) end end break_here() elseif local2 == 24 then start_cat_sfx("twCatBy.wav") if system.currentSet == tw then StartMovie("tb_kitty.snm", nil, 168, 398) end else calculate_cats = TRUE sleep_for(3000) end until local2 == 42 cat_race_running = FALSE start_cat_sfx("kittyBel.wav", TRUE) tb.crowd_cheer(TRUE) if rnd() then track_announcer:say_line("/tbta177/") track_announcer:wait_for_message() track_announcer:say_line("/tbta178/") track_announcer:wait_for_message() sleep_for(5000) end track_announcer:say_line("/tbta174/") track_announcer:wait_for_message() track_announcer:say_line(cat_racers[1].name) track_announcer:wait_for_message() track_announcer:say_line("/tbta175/") track_announcer:wait_for_message() track_announcer:say_line(cat_racers[2].name) track_announcer:wait_for_message() track_announcer:say_line("/tbta176/") track_announcer:wait_for_message() track_announcer:say_line(cat_racers[3].name) track_announcer:wait_for_message() sleep_for(5000) track_announcer:wait_for_message() track_announcer:say_line("/tbta179/") track_announcer:wait_for_message() track_announcer:say_line(cat_racers[1].name) track_announcer:wait_for_message() local2 = 1 track_announcer:say_line("/tbta166/") repeat local2 = local2 + 1 track_announcer:wait_for_message() track_announcer:say_line(cat_racers[local2].name) track_announcer:wait_for_message() cat_names[cat_racers[local2].number].racing = nil if local2 == 1 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds + 3 elseif local2 == 2 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds + 2 elseif local2 == 3 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds + 1 elseif local2 == 4 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds - 0.5 elseif local2 == 5 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds - 1 elseif local2 == 6 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds - 1.5 elseif local2 == 7 then cat_names[cat_racers[local2].number].odds = cat_names[cat_racers[local2].number].odds - 2 end until local2 == tb.NUMBER_OF_CATS sleep_for(2000) track_announcer:say_line("/tbta180/") sleep_for(30000) end end tb.goodbye_doug = function(arg1) -- line 654 if not tb.double_doug then tb.double_doug = TRUE START_CUT_SCENE() stop_script(tb.track_announcer) manny:set_visibility(FALSE) if arg1 == tb.ts_door then doug.look_point = { x = 0.118851, y = -0.539676, z = -0.116 } doug.look_point2 = { x = 0.118851, y = 0.875324, z = -0.145 } else doug.look_point = { x = -0.567064, y = -1.00833, z = 0.495 } doug.look_point2 = { x = -0.175, y = 1.4, z = 0.494 } end tb:current_setup(tb_fotws) doug:setpos(-0.0520684, -1.72162, 0) doug:setrot(0, -353, 0) doug:play_chore(doug_idles_rest, "doug_idles.cos") doug:head_look_at_point(doug.look_point, 300) sleep_for(1000) doug:say_line("/tbdu061/") doug:wait_for_message() doug:head_look_at(nil) doug:say_line("/tbdu062/") doug:wait_for_message() tb:current_setup(tb_strws) sleep_for(2000) tb:current_setup(tb_fotws) break_here() doug:head_look_at_point(doug.look_point, 120) sleep_for(1000) doug:head_look_at(nil, 120) sleep_for(750) doug:say_line("/tbdu063/") doug:wait_for_message() tb:current_setup(tb_strws) sleep_for(1500) doug:setpos(0.102557, 1.84044, 0) doug:fake_walkto(0, 1.63993, 0) doug:wait_for_actor() doug:setrot(0, -160, 0, TRUE) doug:wait_for_actor() doug:fade_in_chore(doug_idles_rest, "doug_idles.cos", 800) doug:say_line("/tbdu064/") sleep_for(500) doug:head_look_at_point(doug.look_point2, 100) sleep_for(750) doug:head_look_at(nil, 130) doug:wait_for_message() doug:say_line("/tbdu065/") sleep_for(1300) doug:head_look_at_point({ x = 0.077, y = 1.4, z = 0.494 }, 130) doug:wait_for_message() doug:head_look_at(nil, 130) sleep_for(1000) END_CUT_SCENE() manny:set_visibility(TRUE) end end tb.search_pockets_for_winning_ticket = function(arg1) -- line 722 local local1, local2 = next(cn.tickets, nil) while local1 do if local2.race == 6 and local2.week == 2 and local2.day == 2 and local2.owner == manny then return TRUE else local1, local2 = next(cn.tickets, local1) end end return FALSE end tb.get_photo = function(arg1) -- line 738 if cn.ticket.owner == manny then if cn.ticket.race == 6 and cn.ticket.week == 2 and cn.ticket.day == 2 then tb.right_photo = TRUE else tb.right_photo = FALSE end end START_CUT_SCENE() doug:say_line("/tbdu001/") doug:wait_for_message() END_CUT_SCENE() if not tb.tried_photo then tb.tried_photo = TRUE START_CUT_SCENE() manny:say_line("/tbma002/") manny:wait_for_message() doug:say_line("/tbdu003/") doug:wait_for_message() manny:say_line("/tbma004/") manny:wait_for_message() doug:say_line("/tbdu005/") doug:wait_for_message() END_CUT_SCENE() end if cn.ticket.owner ~= manny then START_CUT_SCENE() manny:say_line("/tbma006/") manny:wait_for_message() doug:say_line("/tbdu008/") doug:wait_for_message() doug:say_line("/tbdu009/") doug:fake_walkto(-0.487359, -1.81429, 0) doug:wait_for_actor() manny:play_chore(ma_photopass_from_cntr) manny:wait_for_chore() manny:pop_costume() END_CUT_SCENE() else START_CUT_SCENE() cn.ticket:free() manny:stop_chore(manny.hold_chore, "mc.cos") manny:stop_chore(mc_hold, "mc.cos") manny:stop_chore(mc_activate_ticket, "mc.cos") manny.is_holding = nil manny:say_line("/tbma010/") manny:wait_for_message() manny:stop_chore() manny:play_chore(ma_photopass_give_stub) doug:play_chore(doug_idles_take_stub) cn.ticket:free() doug:wait_for_chore() if not tb.given_ticket then tb.given_ticket = TRUE doug:say_line("/tbdu011/") doug:wait_for_message() manny:say_line("/tbma012/") manny:wait_for_message() end doug:play_chore(doug_idles_rid_stub) doug:say_line("/tbdu013/") doug:wait_for_message() doug:wait_for_chore() doug:play_chore(doug_idles_get_photo) doug:say_line("/tbdu014/") doug:wait_for_message() doug:wait_for_chore() doug:say_line("/tbdu015/") doug:play_chore(doug_idles_give_photo) manny:head_look_at(nil) manny:play_chore(ma_photopass_take_envelope) manny:wait_for_chore() doug:wait_for_chore() manny:wait_for_chore() if tb.right_photo and si.photofinish.owner == manny then cur_puzzle_state[32] = TRUE tb.time_to_say_goodbye = TRUE manny:say_line("/tbma016/") manny:wait_for_message() doug:say_line("/tbdu017/") doug:wait_for_message() manny:head_look_at(nil) manny:play_chore(ma_photopass_photo_switch) manny:say_line("/tbma018/") manny:wait_for_message() manny:wait_for_chore() manny:wait_for_chore(ma_photopass_photo_switch, "ma_photopass.cos") manny:play_chore(ma_photopass_return_photo) doug:play_chore(doug_idles_take_photo) manny:say_line("/tbma019/") manny:wait_for_message() doug:say_line("/tbdu020/") doug:wait_for_chore() doug:fake_walkto(-0.387359, -1.81429, 0) doug:wait_for_actor() tb.blackmail_photo:get() si.photofinish:free() else if not tb.got_wrong_photo then tb.got_wrong_photo = TRUE manny:say_line("/tbma021/") manny:wait_for_message() doug:say_line("/tbdu022/") doug:wait_for_message() manny:say_line("/tbma023/") else manny:say_line("/tbma024/") end manny:wait_for_message() manny:play_chore(ma_photopass_return_photo) doug:say_line("/tbdu025/") doug:play_chore(doug_idles_take_photo) doug:wait_for_message() doug:wait_for_chore() doug:fade_out_chore(doug_idles_take_photo, "doug_idles.cos", 500) doug:say_line("/tbdu026/") manny:wait_for_chore() doug:fake_walkto(-0.387359, -1.81429, 0) doug:wait_for_actor() end manny:pop_costume() manny:setpos({ x = 0.031, y = -1.19456, z = 0 }) manny:head_look_at(nil) END_CUT_SCENE() end end tb.set_up_actors = function() -- line 880 if not doug then doug = Actor:create(nil, nil, nil, "Doug") end doug:set_talk_color(Green) doug:set_costume("doug_idles.cos") doug:follow_boxes() doug:set_walk_rate(0.5) doug:put_in_set(tb) doug:set_mumble_chore(doug_idles_mumble) doug:set_talk_chore(1, doug_idles_stop_talk) doug:set_talk_chore(2, doug_idles_a) doug:set_talk_chore(3, doug_idles_c) doug:set_talk_chore(4, doug_idles_e) doug:set_talk_chore(5, doug_idles_f) doug:set_talk_chore(6, doug_idles_l) doug:set_talk_chore(7, doug_idles_m) doug:set_talk_chore(8, doug_idles_o) doug:set_talk_chore(9, doug_idles_t) doug:set_talk_chore(10, doug_idles_u) doug:setpos(0.102557, 1.84044, 0) doug:set_head(3, 4, 5, 165, 28, 80) if tb.needs_intro and not tb.seen_intro then tb.needs_intro = FALSE tb.seen_intro = TRUE start_script(tb.show_room) end end tb.enter = function(arg1) -- line 913 start_script(tb.off_screen_kittys) if not find_script(tb.track_announcer) then tb.init_cat_names() start_script(tb.track_announcer) end tb.set_up_actors() end tb.exit = function() -- line 922 stop_script(tb.off_screen_kittys) doug:free() end tb.photo_window = Object:create(tb, "/tbtx028/Window", -0.065300003, -1.5262001, 0.5, { range = 0.80000001 }) tb.photo_window.use_pnt_x = 0 tb.photo_window.use_pnt_y = -1.16456 tb.photo_window.use_pnt_z = 0 tb.photo_window.use_rot_x = 0 tb.photo_window.use_rot_y = 180 tb.photo_window.use_rot_z = 0 tb.photo_window.lookAt = function(arg1) -- line 940 if not tb.photo_window.tried then system.default_response("nobody") else manny:say_line("/tbma029/") end end tb.photo_window.use = function(arg1) -- line 948 tb.photo_window.tried = TRUE START_CUT_SCENE() manny:walkto_object(arg1) manny:wait_for_actor() manny:push_costume("ma_photopass.cos") if manny.is_holding then manny:blend(ma_photopass_to_counter, ms_hold, 500, "ma_photopass.cos", manny.base_costume) sleep_for(500) manny:stop_chore(ms_hold, "mc.cos") else manny:play_chore(ma_photopass_to_counter) end manny:say_line("/tbma030/") manny:wait_for_message() manny:wait_for_chore() doug:setpos(-0.387359, -1.81429, 0) doug:fake_walkto(-0.0520684, -1.72162, 0) doug:wait_for_actor() doug:setrot(0, -353, 0, TRUE) doug:wait_for_actor() doug:stop_chore() doug:fade_in_chore(doug_idles_rest, "doug_idles.cos", 800) doug:say_line("/tbdu031/") doug:wait_for_message() END_CUT_SCENE() tb:get_photo() end tb.photo_window.use_ticket = tb.photo_window.use tb.bet_window = Object:create(tb, "/tbtx032/window", 0, 1.49, 0.44999999, { range = 0.80000001 }) tb.bet_window.use_pnt_x = -0.086491302 tb.bet_window.use_pnt_y = 1.08706 tb.bet_window.use_pnt_z = 0 tb.bet_window.use_rot_x = 0 tb.bet_window.use_rot_y = 1440.04 tb.bet_window.use_rot_z = 0 tb.bet_window.lookAt = function(arg1) -- line 988 if not tb.bet_window.tried then system.default_response("nobody") else manny:say_line("/tbma033/") end end tb.bet_window.use = function(arg1) -- line 996 local local1 START_CUT_SCENE() manny:walkto_object(arg1) manny:wait_for_actor() manny:push_costume("ma_photopass.cos") if manny.is_holding then manny:blend(ma_photopass_to_counter, ms_hold, 500, "ma_photopass.cos", manny.base_costume) sleep_for(500) manny:stop_chore(ms_hold, "mc.cos") else manny:play_chore(ma_photopass_to_counter) end manny:say_line("/tbma034/") manny:wait_for_message() doug:setpos(0.102557, 1.84044, 0) doug:fake_walkto(0, 1.63993, 0) doug:wait_for_actor() doug:setrot(0, -160, 0, TRUE) doug:wait_for_actor() doug:fade_in_chore(doug_idles_rest, "doug_idles.cos", 800) if not arg1.tried then arg1.tried = TRUE doug:say_line("/tbdu035/") sleep_for(800) doug:push_chore(doug_idles_shake_left) doug:push_chore() doug:push_chore(doug_idles_shake_left) doug:push_chore() doug:wait_for_message() manny:say_line("/tbma036/") manny:wait_for_message() doug:say_line("/tbdu037/") doug:wait_for_message() manny:say_line("/tbma038/") manny:wait_for_message() doug:say_line("/tbdu039/") doug:push_chore(doug_idles_nod) doug:push_chore() doug:push_chore(doug_idles_nod) doug:push_chore() doug:wait_for_message() manny:say_line("/tbma040/") manny:wait_for_message() doug:say_line("/tbdu041/") doug:push_chore(doug_idles_shake_left) doug:push_chore() doug:push_chore(doug_idles_shake_left) doug:push_chore() doug:wait_for_message() if cn.ticket.owner == manny then manny:say_line("/tbma042/") else manny:say_line("/tbma043/") end manny:wait_for_message() else doug:say_line("/tbdu044/") doug:wait_for_message() end local1 = "rest" if cn.ticket.owner == manny then local1 = "rid" cn.ticket:free() manny:say_line("/tbma045/") manny:wait_for_message() manny:play_chore(ma_photopass_give_stub) doug:play_chore(doug_idles_take_stub) doug:wait_for_chore() doug:say_line("/tbdu046/") doug:wait_for_message() doug:play_chore(doug_idles_rid_stub) if tb.tried_fake then doug:say_line("/tbdu047/") else tb.tried_fake = TRUE doug:say_line("/tbdu048/") doug:wait_for_message() manny:say_line("/tbma049/") end doug:wait_for_chore() end manny:wait_for_message() if local1 == "rest" then doug:fade_out_chore(doug_idles_rest, "doug_idles.cos", 500) else doug:fade_out_chore(doug_idles_rid_stub, "doug_idles.cos", 500) end doug:say_line("/tbdu050/") doug:wait_for_message() manny:play_chore(ma_photopass_from_cntr) doug:fake_walkto(0.102557, 1.84044, 0) doug:wait_for_actor() manny:wait_for_chore(ma_photopass_from_cntr, "ma_photopass.cos") manny:pop_costume() END_CUT_SCENE() end tb.bet_window.use_ticket = tb.bet_window.use tb.blackmail_photo = Object:create(tb, "/tbtx051/incriminating photo", 0, 0, 0, { range = 0 }) tb.blackmail_photo.string_name = "blackmail" tb.blackmail_photo.wav = "getcard.wav" tb.blackmail_photo.lookAt = function(arg1) -- line 1104 manny:say_line("/tbma052/") end tb.blackmail_photo.use = tb.blackmail_photo.lookAt tb.blackmail_photo.default_response = function(arg1) -- line 1110 manny:say_line("/tbma053/") end tb.bet_obj = Object:create(tb, "", -0.173969, 1.63993, 0, { range = 0 }) tb.bet_obj.use_pnt_x = -0.173969 tb.bet_obj.use_pnt_y = 1.63993 tb.bet_obj.use_pnt_z = 0 tb.bet_obj.use_rot_x = 0 tb.bet_obj.use_rot_y = -160.77299 tb.bet_obj.use_rot_z = 0 tb.photo_obj = Object:create(tb, "", 0.072068401, -1.72162, 0, { range = 0 }) tb.photo_obj.use_pnt_x = 0.072068401 tb.photo_obj.use_pnt_y = -1.72162 tb.photo_obj.use_pnt_z = 0 tb.photo_obj.use_rot_x = 0 tb.photo_obj.use_rot_y = -352.745 tb.photo_obj.use_rot_z = 0 tb.ts_door = Object:create(tb, "/tbtx056/door", 0.80000001, 0, -0.1, { range = 0 }) tb.ts_door.use_pnt_x = 0.33327299 tb.ts_door.use_pnt_y = -0.0051976298 tb.ts_door.use_pnt_z = -0.26751199 tb.ts_door.use_rot_x = 0 tb.ts_door.use_rot_y = -87.913498 tb.ts_door.use_rot_z = 0 tb.ts_door.out_pnt_x = 0.68868601 tb.ts_door.out_pnt_y = 0.01196 tb.ts_door.out_pnt_z = -0.45457199 tb.ts_door.out_rot_x = 0 tb.ts_door.out_rot_y = -87.913498 tb.ts_door.out_rot_z = 0 tb.ts_box = tb.ts_door tb.ts_door.walkOut = function(arg1) -- line 1160 if tb.time_to_say_goodbye and not tb.said_goodbye then tb.goodbye_doug(arg1) end ts:come_out_door(ts.tb_door) end tb.hh_door = Object:create(tb, "/tbtx057/door", -0.80000001, 2.2, 0.54000002, { range = 0 }) tb.hh_door.use_pnt_x = -0.82007802 tb.hh_door.use_pnt_y = 1.23658 tb.hh_door.use_pnt_z = -3.7268402e-09 tb.hh_door.use_rot_x = 0 tb.hh_door.use_rot_y = -0.674227 tb.hh_door.use_rot_z = 0 tb.hh_door.out_pnt_x = -0.81631702 tb.hh_door.out_pnt_y = 1.5407701 tb.hh_door.out_pnt_z = 0.103325 tb.hh_door.out_rot_x = 0 tb.hh_door.out_rot_y = -0.674227 tb.hh_door.out_rot_z = 0 tb.hh_box = tb.hh_door tb.hh_door.walkOut = function(arg1) -- line 1185 if tb.time_to_say_goodbye and not tb.said_goodbye then tb.goodbye_doug(arg1) end hh:come_out_door(hh.tb_door) end tb.gt_door = Object:create(tb, "/tbtx058/door", -4.0999999, 0, 1.8, { range = 0.60000002 }) tb.gt_door.use_pnt_x = -1.73559 tb.gt_door.use_pnt_y = 0.057845 tb.gt_door.use_pnt_z = 0.206 tb.gt_door.use_rot_x = 0 tb.gt_door.use_rot_y = -2071.6899 tb.gt_door.use_rot_z = 0 tb.gt_door.out_pnt_x = -3.5209701 tb.gt_door.out_pnt_y = 0.0504007 tb.gt_door.out_pnt_z = 0.98903102 tb.gt_door.out_rot_x = 0 tb.gt_door.out_rot_y = -2057.8101 tb.gt_door.out_rot_z = 0 tb.gt_box = tb.gt_door tb.gt_door.walkOut = function(arg1) -- line 1211 if tb.time_to_say_goodbye and not tb.said_goodbye then tb.goodbye_doug(arg1) end gt:come_out_door(gt.tb_door) end tb.tw_door = Object:create(tb, "/tbtx059/door", -4.0999999, 0, 1.8, { range = 0.60000002 }) tb.tw_door.use_pnt_x = 0 tb.tw_door.use_pnt_y = 0 tb.tw_door.use_pnt_z = 0 tb.tw_door.use_rot_x = 0 tb.tw_door.use_rot_y = 0 tb.tw_door.use_rot_z = 0 tb.tw_door.out_pnt_x = 0 tb.tw_door.out_pnt_y = 0 tb.tw_door.out_pnt_z = 0 tb.tw_door.out_rot_x = 0 tb.tw_door.out_rot_y = 0 tb.tw_door.out_rot_z = 0 tb.tw_box = tb.tw_door tb.tw_door.walkOut = function(arg1) -- line 1235 local local1, local2, local3 START_CUT_SCENE() local1, local2, local3 = GetActorPos(system.currentActor.hActor) tw:switch_to_set() PutActorInSet(system.currentActor.hActor, tw.setFile) PutActorAt(system.currentActor.hActor, local1, local2, local3) END_CUT_SCENE() end tb.tw1_door = Object:create(tb, "/tbtx060/door", -4.0999999, 0, 1.8, { range = 0.60000002 }) tb.tw1_door.use_pnt_x = 0 tb.tw1_door.use_pnt_y = 0 tb.tw1_door.use_pnt_z = 0 tb.tw1_door.use_rot_x = 0 tb.tw1_door.use_rot_y = 0 tb.tw1_door.use_rot_z = 0 tb.tw1_door.out_pnt_x = 0 tb.tw1_door.out_pnt_y = 0 tb.tw1_door.out_pnt_z = 0 tb.tw1_door.out_rot_x = 0 tb.tw1_door.out_rot_y = 0 tb.tw1_door.out_rot_z = 0 tb.tw1_box = tb.tw1_door tb.tw1_door.walkOut = function(arg1) -- line 1262 local local1, local2, local3 START_CUT_SCENE() local1, local2, local3 = GetActorPos(system.currentActor.hActor) tw:switch_to_set() PutActorInSet(system.currentActor.hActor, tw.setFile) PutActorAt(system.currentActor.hActor, local1, local2, local3) END_CUT_SCENE() end CheckFirstTime("me.lua") me = Set:create("me.set", "meadow exterior", { me_carla = 0, me_carla2 = 0, me_carla3 = 0, me_carla4 = 0, me_carla5 = 0, me_carla6 = 0, me_carla7 = 0, me_pmpws = 1, me_pmpws2 = 1, me_pmpws3 = 1, me_pmpws4 = 1, me_pmpws5 = 1, me_pmpws6 = 1, me_shtgh = 2, me_shtgh2 = 2, me_rerws = 3, me_ovrhd = 4, me_rerha = 5, me_rerha2 = 5, me_rerha3 = 5, me_rerha4 = 5, me_salcu = 6, me_olvms = 7, me_sptcu = 8, me_dorcu = 9 }) me.cheat_boxes = { cheat1 = 0 } dofile("ol_gun.lua") dofile("ol_suitcase.lua") dofile("ol_dies.lua") dofile("md_search_sal.lua") dofile("md_gun.lua") dofile("md_shooting.lua") dofile("md_green_door.lua") dofile("me_backdoor.lua") dofile("me_frontdoor.lua") dofile("md_hold_tix.lua") dofile("he_greenhouse.lua") dofile("me_trunk.lua") dofile("shootout.lua") me.olivia_talk_count = 0 me.flower_point = { x = 18.3018, y = -21.0012, z = -7.61071 } me.olivia_hector_point = { x = 16.213, y = -19.2214, z = -7.18187 } me.suitcase_point1 = { x = 18.8761, y = -19.781, z = -7.67824 } me.suitcase_point2 = { x = 18.9601, y = -19.946, z = -7.67824 } me.ol_run_point = { x = 17.3648, y = -20.7248, z = -7.22155 } me.sal_music = FALSE me.shootout_music = FALSE me.end_music = FALSE me.greenhouse_approach_music = FALSE me.water_pump_vol = 20 me.water_pump_pan = 20 me.olivia_searching = function() -- line 60 me.heard_olivia_search = TRUE olivia:say_line("/meol013/") wait_for_message() olivia:say_line("/meol014/") sleep_for(2000) olivia:say_line("/meol015/") end olivia.meadow_default = function(arg1) -- line 70 olivia:free() olivia:set_costume("olivia_talks.cos") olivia:set_mumble_chore(olivia_talks_mumble) olivia:set_talk_chore(1, olivia_talks_stop_talk) olivia:set_talk_chore(2, olivia_talks_a) olivia:set_talk_chore(3, olivia_talks_c) olivia:set_talk_chore(4, olivia_talks_e) olivia:set_talk_chore(5, olivia_talks_f) olivia:set_talk_chore(6, olivia_talks_l) olivia:set_talk_chore(7, olivia_talks_m) olivia:set_talk_chore(8, olivia_talks_o) olivia:set_talk_chore(9, olivia_talks_t) olivia:set_talk_chore(10, olivia_talks_u) olivia:push_costume("ol_gun.cos") olivia:ignore_boxes() olivia:set_head(5, 6, 7, 165, 28, 80) olivia:set_look_rate(110) olivia:set_visibility(TRUE) end me.pester_olivia = function() -- line 91 START_CUT_SCENE() me.olivia_talk_count = me.olivia_talk_count + 1 manny:stop_walk() start_script(manny.turn_toward_entity, manny, me.olivia_obj) manny:head_look_at(me.olivia_obj) olivia:play_chore(ol_gun_threaten, "ol_gun.cos") if me.olivia_talk_count == 1 then wait_for_message() olivia:say_line("/meol006/") wait_for_message() manny:say_line("/mema007/") wait_for_message() olivia:say_line("/meol008/") wait_for_message() olivia:say_line("/meol009/") elseif me.olivia_talk_count == 2 then olivia:say_line("/meol010/") elseif me.olivia_talk_count == 3 then olivia:say_line("/meol011/") else olivia:say_line("/meol012/") end olivia:wait_for_message() manny:head_look_at(nil) stop_script(manny.turn_toward_entity) manny:walk_and_face(15.0038, -19.01, -7.97882, 0, 67.2536, 0) END_CUT_SCENE() end me.olivia_search_idles = function() -- line 122 while 1 do olivia:play_chore(ol_suitcase_suitcase, "ol_suitcase.cos") if rnd() then sleep_for(2000 * random()) olivia:play_chore(ol_suitcase_suitcase_hold, "ol_suitcase.cos") olivia:fade_out_chore(ol_suitcase_suitcase, "ol_suitcase.cos", 500) else olivia:wait_for_chore(ol_suitcase_suitcase, "ol_suitcase.cos") end repeat olivia:head_look_at_point(me.suitcase_point1) sleep_for(1000 + 3000 * random()) olivia:head_look_at_point(me.suitcase_point2) sleep_for(1000 + 3000 * random()) until rnd() olivia:head_look_at(nil) end end me.ol_scoot_in = function(arg1) -- line 150 local local1 repeat olivia:offsetBy(0, 0.050000001, 0) break_here() local1 = olivia:getpos() until local1.y >= -19.4884 end me.ol_scoot_out = function(arg1) -- line 161 local local1 stop_script(me.ol_scoot_in) manny:play_chore_looping(md_back_off, "md.cos") manny:ignore_boxes() repeat local1 = 0 - PerSecond(0.30000001) olivia:offsetBy(0, local1, 0) manny:offsetBy(0, local1, 0) break_here() ol_pos = olivia:getpos() until ol_pos.y <= -19.700001 end me.salvador_goodbye = function(arg1) -- line 182 salvador.sprouted = TRUE START_CUT_SCENE() set_override(me.salvador_goodbye_override) olivia:set_visibility(TRUE) stop_script(me.olivia_search_idles) manny:wait_for_message() salvador:play_chore(ol_dies_sal_eyes_open, "ol_dies.cos") sleep_for(500) salvador:say_line("/hisa001/") manny:walk_and_face(17.6867, -19.4394, -7.84747, 0, 340.695, 0) wait_for_message() salvador:say_line("/hisa002/") wait_for_message() salvador:say_line("/hisa003/") wait_for_message() manny:say_line("/hima004/") manny:nod_head_gesture() wait_for_message() salvador:say_line("/hisa005/") wait_for_message() salvador:say_line("/hisa006/") wait_for_message() salvador:say_line("/hisa007/") wait_for_message() manny:say_line("/hima008/") manny:tilt_head_gesture() manny:hand_gesture() sleep_for(500) music_state:set_state(stateEND) olivia:meadow_default() olivia:pop_costume() olivia:push_costume("ol_dies.cos") olivia:put_in_set(me) olivia:setpos(16.8976, -19.5694, -7.787) olivia:setrot(0, 160.021, 0) olivia:play_chore(ol_dies_stickup_manny, "ol_dies.cos") start_script(me.ol_scoot_in) manny:wait_for_message() olivia:say_line("/hiol009/") wait_for_script(me.ol_scoot_in) start_script(me.ol_scoot_out) olivia:wait_for_message() salvador:say_line("/hisa010/") salvador:wait_for_message() wait_for_script(me.ol_scoot_out) system:lock_display() olivia:setpos(16.9006, -19.8874, -7.689) olivia:setrot(0, 191.438, 0) manny:put_in_set(nil) me:current_setup(me_olvms) olivia:play_chore(ol_dies_push_ma_out, "ol_dies.cos") system:unlock_display() olivia:wait_for_chore(ol_dies_push_ma_out, "ol_dies.cos") olivia:say_line("/hiol011/") olivia:run_chore(ol_dies_get_sal_head, "ol_dies.cos") olivia:play_chore(ol_dies_obtained_head, "ol_dies.cos") olivia:wait_for_message() olivia:wait_for_chore(ol_dies_obtained_head, "ol_dies.cos") sleep_for(500) olivia:say_line("/hiol012/") system:lock_display() me:current_setup(me_sptcu) olivia:setpos(16.8196, -20.1124, -7.602) olivia:setrot(0, 204.316, 0) olivia:play_chore(ol_dies_talk2sal, "ol_dies.cos") system:unlock_display() sleep_for(500) olivia:run_chore(ol_dies_prespit, "ol_dies.cos") olivia:wait_for_message() salvador:ignore_boxes() salvador:setpos(16.8196, -20.1124, -7.602) salvador:setrot(0, 204.316, 0) salvador:play_chore(ol_dies_sal_talk_hold2, "ol_dies.cos") olivia:play_chore(ol_dies_talk_hold2, "ol_dies.cos") salvador:say_line("/hisa013/") music_state:set_sequence(seqSalvadorDeath) me.sal_music = FALSE music_state:update(system.currentSet) salvador:wait_for_message() salvador:say_line("/hisa014/") salvador:wait_for_message() salvador:set_visibility(FALSE) salvador:set_speech_mode(MODE_BACKGROUND) salvador:say_line("/hisa013b/") olivia:play_chore(ol_dies_spit, "ol_dies.cos") sleep_for(500) olivia:say_line("/hiol015/") salvador:say_line("/hisa016/") olivia:wait_for_chore(ol_dies_spit, "ol_dies.cos") olivia:play_chore(ol_dies_run, "ol_dies.cos") start_sfx("zw_trail.wav") manny:put_in_set(me) manny:setpos(17.6851, -20.1075, -7.80871) manny:setrot(0, 42.4447, 0) manny:default() manny:follow_boxes() manny:head_look_at_point(me.ol_run_point) manny:set_walk_rate(0.5) start_script(manny.walk_and_face, manny, 17.3648, -19.7388, -7.84155, 0, 175.622, 0) sleep_for(2000) start_sfx("salSprt.wav") me.salvador_obj:onGround() manny:head_look_at(me.salvador_obj) sleep_for(500) olivia:wait_for_message() olivia:say_line("/hiol017/") sleep_for(1000) system:lock_display() me:current_setup(me_carla) olivia:setpos(17.0536, -20.7594, -7.798) olivia:setrot(0, 226.5, 0) me.salflowers:here() me.suitcase:setUp() system:unlock_display() olivia:play_chore(ol_dies_run, "ol_dies.cos") olivia:wait_for_chore(ol_dies_run, "ol_dies.cos") olivia:wait_for_message() END_CUT_SCENE() me.setup_part3() end me.salvador_goodbye_override = function() -- line 326 kill_override() salvador.sprouted = TRUE stop_script(me.olivia_search_idles) stop_script(me.ol_scoot_in) stop_script(me.ol_scoot_out) me:setup_part3() manny:default() manny:setpos(17.3648, -19.7388, -7.84155) manny:setrot(0, 175.622, 0) me:current_setup(me_carla) system:unlock_display() end Atest = function() -- line 340 local local1, local2, local3, local4 if not me.sals_body.act then me.sals_body:setup() end while 1 do local1 = manny:get_positive_yaw_to_point({ x = me.sals_body.obj_x, y = me.sals_body.obj_y, z = me.sals_body.obj_z }) local4 = manny:get_positive_rot() local3 = local4.y local2 = abs(local1 - local3) if local2 > 180 then local2 = 360 - local2 end ExpireText() print_temporary("gpytp:" .. local1 .. ", posrot: " .. local3 .. ", diff: " .. local2) break_here() end end Xangle_to_obj = function(arg1) -- line 362 local local1, local2, local3, local4 local1 = manny:get_positive_yaw_to_point({ x = arg1.obj_x, y = arg1.obj_y, z = arg1.obj_z }) local4 = manny:get_positive_rot() local3 = local4.y local2 = abs(local1 - local3) if local2 > 180 then local2 = 360 - local2 end return local2 end me.sal_detector = function() -- line 376 local local1, local2 while 1 do if object_proximity(me.salvador_obj) < 0.89999998 then if abs(Xangle_to_obj(me.salvador_obj)) < 90 then me.ticket:activated(me.salvador_obj) if not me.detected_head then me.detected_head = TRUE me.ticket:lookAt(me.salvador_obj) end else me.ticket:dormant() end else local1 = object_proximity(me.sals_body) if local1 < 3 then if GetAngleBetweenActors(manny.hActor, me.sals_body.interest_actor.hActor) < 35 then if local1 < 0.5 then start_script(me.tix_fly_to_body) else me.ticket:activated(me.sals_body) end if not me.detected_body then me.detected_body = TRUE me.ticket:lookAt() end else me.ticket:dormant() end else me.ticket:dormant() end end break_here() end end me.tix_fly_to_body = function() -- line 427 local local1, local2, local3 = GetActorNodeLocation(manny.hActor, 12) local local4 local local5 = manny:getpos() stop_script(me.sal_detector) START_CUT_SCENE() me.ticket:put_in_limbo() me.ticket.active = FALSE fade_sfx("tixvibe.imu") me.ticket:dormant(TRUE) if not sals_ticket then sals_ticket = Actor:create() end sals_ticket:ignore_boxes() sals_ticket:set_costume("tix.cos") sals_ticket:put_in_set(me) sals_ticket:setpos(local1, local2, local3) sals_ticket:setrot(manny:getrot()) sals_ticket:play_chore_looping(0) manny:stop_chore(md_activate_ticket, "md.cos") manny:stop_chore(md_activate_tix_nowig, "md.cos") repeat break_here() sals_ticket:offsetBy(0, 0, -0.050000001) local4 = sals_ticket:getpos() manny:head_look_at(sals_ticket) until local4.z <= local5.z manny:stop_chore(md_hand_on_obj, "md.cos") manny:stop_chore(md_hold, "md.cos") sals_ticket:follow_boxes() sals_ticket:set_walk_rate(0.40000001) start_script(sals_ticket.walkto, sals_ticket, me.sals_body.obj_x, me.sals_body.obj_y, me.sals_body.obj_z) while find_script(sals_ticket.walkto) do manny:head_look_at(sals_ticket) break_here() end sals_ticket:wait_for_actor() sals_ticket:ignore_boxes() sals_ticket:offsetBy(0, 0, 0.050000001) manny:head_look_at(sals_ticket) END_CUT_SCENE() me:cut_flowers() end me.cut_flowers = function(arg1) -- line 480 START_CUT_SCENE() manny:walkto_object(me.sals_body) manny:wait_for_actor() manny:set_rest_chore(nil) manny:run_chore(md_takeout_scythe, "md.cos") stop_sound("tixvibe.imu") start_script(cut_scene.cut_flowers) me.sals_body:setup() wait_for_script(cut_scene.cut_flowers) manny:stop_chore(md_takeout_scythe, "md.cos") manny:run_chore(md_putback_scythe, "md.cos") manny:stop_chore(md_putback_scythe, "md.cos") manny:set_rest_chore(md_rest, "md.cos") END_CUT_SCENE() end me.search_salvador = function(arg1) -- line 500 START_CUT_SCENE() salvador.searched = TRUE manny:push_costume("md_search_sal.cos") manny:run_chore(md_search_sal_search, "md_search_sal.cos") manny:stop_chore(md_search_sal_search, "md_search_sal.cos") manny:pop_costume() manny:generic_pickup(me.key) me.key:lookAt() END_CUT_SCENE() me.car:setup() end me.kill_hector = function() -- line 520 me.hector_dying = TRUE cur_puzzle_state[60] = TRUE hector.dying = TRUE me.shootout_music = TRUE music_state:update() START_CUT_SCENE() manny:wait_for_actor() start_script(me.manny_shoot) sleep_for(200) manny:set_visibility(FALSE) StartMovie("me_tank.snm") sleep_for(100) start_sfx("me_gun.wav", nil, 100) sleep_for(200) start_sfx("me_gun.wav", nil, 127) sleep_for(300) start_sfx("me_gun.wav", nil, 80) sleep_for(200) start_sfx("me_gun.wav", nil, 127) while sound_playing("me_gun.wav") do break_here() end wait_for_movie() me.darts:play_chore(0) manny:set_visibility(TRUE) music_state:update() start_sfx("me_tank3.wav", IM_HIGH_PRIORITY, 127) set_pan("me_tank3.wav", 0) fade_pan_sfx("me_tank3.wav", 7000, 80) fade_sfx("me_tank3.wav", 7000, 50) sleep_for(1000) manny:head_look_at_point({ x = -3.55053, y = -15.6068, z = -5.94586 }, 40) sleep_for(1000) manny:head_look_at_point({ x = -3.50753, y = -13.8818, z = -5.94186 }, 40) sleep_for(3000) manny:head_look_at_point({ x = -3.91453, y = -8.2748, z = -2.72986 }, 40) sleep_for(3000) wait_for_sound("me_tank3.wav") set_vol("mePump.imu", 0) start_script(cut_scene.hecgetit) me.gun:put_away() manny:head_look_at(me.greenhouse) wait_for_script(cut_scene.hecgetit) set_vol("mePump.imu", me.water_pump_vol) me.end_music = TRUE music_state:update() hector:say_line("/mehe040/", { volume = 25 }) wait_for_message() sleep_for(750) hector:say_line("/mehe041/", { volume = 25 }) wait_for_message() manny:turn_toward_entity(me.greenhouse) stop_script(hector.run_around_nervously) start_script(hector.part_1_idle) END_CUT_SCENE() hector:say_line("/mehe042/", { volume = 25 }) wait_for_message() if not manny:is_moving() then manny:twist_head_gesture() end manny:say_line("/tuma048/") manny:head_look_at(nil) end me.blow_hector_up = function() -- line 611 START_CUT_SCENE("no head") stop_script(hector.run_around_nervously) stop_script(hector.part_1_idle) cameraman_disabled = TRUE me:current_setup(me_dorcu) manny:put_at_object(me.door) manny:push_costume("md_green_door.cos") manny:push_costume("md_green_door.cos") if manny.is_holding ~= me.gun then manny:run_chore(md_take_out_get, "md.cos") manny:stop_chore(md_take_out_get, "md.cos") manny:complete_chore(md_activate_gun, "md.cos") manny:run_chore(md_takeout_big, "md.cos") manny.is_holding = he.gun end manny:complete_chore(md_green_door_show_gun, "md_green_door.cos") manny:set_time_scale(0.2) manny:play_chore(md_green_door_open_door, "md_green_door.cos") sleep_for(2000) me:current_setup(me_shtgh) manny:play_chore(md_green_door_open_door, "md_green_door.cos") sleep_for(3000) me:current_setup(me_dorcu) manny:set_time_scale(1) fade_sfx("scaryMus.imu", 700, 0) play_movie("me_splat.snm", 135, 30) wait_for_movie() PreRender(FALSE, FALSE) stop_script(TrackManny) manny:free() hector:free() start_script(cut_scene.hecdie, cut_scene) wait_for_script(cut_scene.hecdie) wait_for_movie() start_script(cut_scene.byebye, cut_scene) END_CUT_SCENE() end hector.part_1_idle = function() -- line 650 hector:meadow_default() hector:put_in_set(me) hector:follow_boxes() hector:setpos(-2.65024, 0.658079, 0.266058) hector:setrot(0, 72.3787, 0) hector:complete_chore(he_greenhouse_hide_gun, "he_greenhouse.cos") while 1 do hector:setrot(0, 65 + 14 * random(), 0, TRUE) hector:fade_in_chore(he_greenhouse_shoot_to_aim, "he_greenhouse.cos") sleep_for(1000 + 3000 * random()) hector:setrot(0, 65 + 14 * random(), 0, TRUE) hector:fade_out_chore(he_greenhouse_shoot_to_aim, "he_greenhouse.cos") sleep_for(1000 + 3000 * random()) hector:setrot(0, 65 + 14 * random(), 0, TRUE) hector:fade_in_chore(he_greenhouse_aim_pos, "he_greenhouse.cos") sleep_for(1000 + 3000 * random()) hector:setrot(0, 65 + 14 * random(), 0, TRUE) hector:fade_out_chore(he_greenhouse_aim_pos, "he_greenhouse.cos", 2000) sleep_for(1000 + 3000 * random()) end end me.meadow_setup = function() -- line 679 me.seen_intro = TRUE START_CUT_SCENE() mo.scythe:free() me.greenhouse_approach_music = TRUE music_state:update() box_off("return_trigger") cameraman_disabled = TRUE LoadCostume("md.cos") LoadCostume("ol_gun.cos") LoadCostume("md_out_car.cos") me:switch_to_set() me:current_setup(me_carla) olivia:free() manny:put_in_set(nil) IrisDown(447, 333, 0) me.brakeson:complete_chore(0) IrisUp(447, 333, 750) start_sfx("me_idlof.wav", nil, 0) set_pan("me_idlof.wav", 80) fade_sfx("me_idlof.wav", 500, 127) sleep_for(2000) me.brakeson:complete_chore(1) sleep_for(1000) set_override(me.meadow_setup_override) olivia:meadow_default() olivia:setpos(16.9008, -19.0563, -7.83171) olivia:setrot(0, 76.592, 0) olivia:put_in_set(me) manny:ignore_boxes() if manny:get_costume() ~= "md_out_car.cos" then manny:push_costume("md_out_car.cos") end manny:setpos(17.3898, -19.8948, -7.73594) manny:setrot(0, 121.281, 0) manny:set_rest_chore(nil) olivia:play_chore(ol_gun_exit_car, "ol_gun.cos") sleep_for(2000) start_script(me.meadow_setup_lines) sleep_for(3000) manny:put_in_set(me) manny:play_chore(0) sleep_for(3000) manny:wait_for_chore(0) manny:default() manny:setpos(17.5089, -19.8846, -7.82701) manny:setrot(0, 114.323, 0) me:current_setup(me_olvms) cameraman_disabled = TRUE manny:say_line("/mema003/") sleep_for(1500) manny:setrot(0, 163.216, 0, TRUE) manny:wait_for_message() olivia:say_line("/meol004/") sleep_for(1000) manny:walkto(17.2124, -20.0749, -7.84546) manny:wait_for_actor() manny:walkto(16.5468, -19.9913, -7.90947) manny:wait_for_actor() manny:setpos(15.7866, -19.4642, -8.01275) manny:setrot(0, 59.4728, 0) me:current_setup(me_carla) me.backdoor:play_chore(me_backdoor_closing) manny:walkto(14.8248, -18.9458, -8.11348) olivia:play_chore(ol_gun_gesture, "ol_gun.cos") olivia:wait_for_message() manny:head_look_at(me.olivia_obj) olivia:say_line("/meol005/") olivia:wait_for_message() me:current_setup(me_carla) manny:default() manny:head_look_at(nil) olivia:head_look_at(nil) stop_script(manny.walk_and_face) manny:setpos(15.0038, -19.01, -8.09936) manny:setrot(0, 277.84, 0, TRUE) box_on("return_trigger") cameraman_disabled = FALSE END_CUT_SCENE() end hector.meadow_default = function(arg1) -- line 775 hector:free() hector:set_costume("he_praise.cos") hector:set_mumble_chore(he_praise_mumble) hector:set_talk_chore(1, he_praise_stop_talk) hector:set_talk_chore(2, he_praise_a) hector:set_talk_chore(3, he_praise_c) hector:set_talk_chore(4, he_praise_e) hector:set_talk_chore(5, he_praise_f) hector:set_talk_chore(6, he_praise_l) hector:set_talk_chore(7, he_praise_m) hector:set_talk_chore(8, he_praise_o) hector:set_talk_chore(9, he_praise_t) hector:set_talk_chore(10, he_praise_u) hector:push_costume("he_greenhouse.cos") hector:set_walk_chore(he_greenhouse_run_cycle, "he_greenhouse.cos") hector:set_head(5, 6, 7, 165, 28, 80) hector:set_walk_rate(1.5) hector:set_turn_rate(360) hector:set_rest_chore(he_greenhouse_crouch_rest, "he_greenhouse.cos") end me.meadow_setup_override = function() -- line 797 stop_script(me.meadow_setup_lines) kill_override() me:switch_to_set() me:current_setup(me_carla) olivia:meadow_default() olivia:setpos(16.9008, -19.0563, -7.83171) olivia:setrot(0, 76.592, 0) olivia:put_in_set(me) olivia:play_chore(ol_gun_defpose, "ol_gun.cos") olivia:head_look_at(nil) single_start_script(hector.part_1_idle) me.brakeson:complete_chore(1) manny:default() manny:setpos(15.0038, -19.01, -7.97882) manny:setrot(0, 67.2536, 0) manny:head_look_at(nil) me.backdoor:complete_chore(me_backdoor_closed) me.frontdoor:complete_chore(me_frontdoor_closed) box_on("return_trigger") box_off("me_salcu") cameraman_disabled = FALSE system:unlock_display() end me.meadow_setup_lines = function() -- line 822 olivia:say_line("/meol001/") wait_for_message() olivia:say_line("/meol002/") end me.setup_part2 = function() -- line 828 single_start_script(hector.part_1_idle) manny.healed = TRUE me.backdoor:play_chore(me_backdoor_open) olivia:meadow_default() olivia:push_costume("ol_suitcase.cos") olivia:setpos(18.5508, -19.8835, -7.81814) olivia:setrot(0, 288.887, 0) olivia:put_in_set(me) me.olivia_obj:behindCar() salvador:free() salvador:set_costume("ol_dies.cos") salvador:set_mumble_chore(ol_dies_mumble) salvador:set_talk_chore(1, ol_dies_no_talk) salvador:set_talk_chore(2, ol_dies_a) salvador:set_talk_chore(3, ol_dies_c) salvador:set_talk_chore(4, ol_dies_e) salvador:set_talk_chore(5, ol_dies_f) salvador:set_talk_chore(6, ol_dies_l) salvador:set_talk_chore(7, ol_dies_m) salvador:set_talk_chore(8, ol_dies_o) salvador:set_talk_chore(9, ol_dies_t) salvador:set_talk_chore(10, ol_dies_u) salvador:complete_chore(ol_dies_just_head, "ol_dies.cos") salvador:ignore_boxes() salvador:setpos(16.988, -19.828, -7.74) salvador:setrot(0, 190.282, 0) salvador:complete_chore(ol_dies_sal_eyes_closed, "ol_dies.cos") salvador:put_in_set(me) me.salvador_obj:make_touchable() box_off("ol_car1") box_off("ol_car2") box_off("ol_car3") box_off("ol_car4") box_off("ol_car5") box_off("ol_car6") box_off("ol_car65") box_off("ol_car7") box_off("ol_car8") box_off("ol_car9") box_off("ol_car10") box_off("ol_car11") box_off("ol_car12") box_off("ol_car13") box_off("suitcase1") box_off("suitcase2") box_off("backdoor_box") box_off("return_trigger") box_on("me_salcu") if not me.door_flowers.hObjectState then me.door_flowers.hObjectState = me:add_object_state(me_carla, "me_door_flowers.bm", "me_door_flowers.zbm", OBJSTATE_STATE, TRUE) me.door_flowers:set_object_state("me_door_flowers.cos") end start_script(me.olivia_search_idles) end me.salcu_setup = function(arg1) -- line 894 manny:setpos(17.6867, -19.4394, -7.84747) me.sal_music = TRUE music_state:update(system.currentSet) end me.setup_part3 = function() -- line 902 if me.gun.owner == manny then me.setup_shootout() end if me.shootout_begun then stop_script(hector.part_1_idle) else single_start_script(hector.part_1_idle) end stop_script(me.olivia_search_idles) olivia:free() me.olivia_obj:make_untouchable() manny.healed = TRUE salvador.sprouted = TRUE box_off("return_trigger") me.backdoor:complete_chore(me_backdoor_open) box_off("backdoor_box") if me.ticket_free and not me.plucked_ticket then me.salflowers:haveTicket() else me.salflowers:noTicket() end salvador:free() me.salvador_obj:onGround() if not me.scy then me.scy = Actor:create() end me.scy:set_costume("scythe_folded.cos") me.scy:put_in_set(me) me.scy:ignore_boxes() me.scy:set_visibility(TRUE) me.scy:setpos(18.6811, -19.8932, -7.73316) me.scy:setrot(80, 180, 120) me.suitcase:setUp() me.car:setup() box_on("ol_car1") box_on("ol_car2") box_on("ol_car3") box_on("ol_car4") box_on("ol_car5") box_on("ol_car6") box_on("ol_car65") box_on("ol_car7") box_on("ol_car8") box_on("ol_car9") box_on("ol_car10") box_on("ol_car11") box_on("ol_car12") box_on("ol_car13") box_on("me_salcu") box_off("suitcase1") box_off("suitcase2") box_off("me_salcu") me.salflowers:here() end me.update_meadow_states = function() -- line 967 if manny.healed then if salvador.sprouted then me.setup_part3() else me.setup_part2() end else me.meadow_setup_override() end end me.pm = function() -- line 979 me:current_setup(me_carla) manny:setpos(15.0038, -19.01, -7.97882) manny:setrot(0, 67.2536, 0) end me.update_music_state = function(arg1) -- line 990 if me.end_music then return stateEND elseif me.shootout_music then return stateSHOOT elseif me.greenhouse_approach_music then return stateGE elseif me.sal_music then return stateHI else return stateME end end me.enter = function(arg1) -- line 1004 box_off("return_trigger") if salvador.sprouted then me.olivia_obj:make_untouchable() me.suitcase:make_touchable() end me.backdoor.hObjectState = me:add_object_state(me_carla, "me_backdoor.bm", "me_backdoor.zbm", OBJSTATE_STATE, FALSE) me.backdoor:set_object_state("me_backdoor.cos") me.salflowers.hObjectState = me:add_object_state(me_carla, "me_salflowers.bm", "me_salflowers.zbm", OBJSTATE_STATE, TRUE) me.salflowers:set_object_state("me_salflowers.cos") me.brakeson.hObjectState = me:add_object_state(me_carla, "me_brakeson.bm", nil, OBJSTATE_STATE, FALSE) me.brakeson:set_object_state("me_brakeson.cos") me.frontdoor.hObjectState = me:add_object_state(me_carla, "me_frontdoor.bm", nil, OBJSTATE_STATE, FALSE) me.frontdoor:set_object_state("me_frontdoor.cos") me.update_meadow_states() if me:current_setup() == me_pmpws then start_sfx("mePump.imu", IM_HIGH_PRIORITY, me.water_pump_vol) set_pan("mePump.imu", me.water_pump_pan) end start_script(me.get_nitro, me) SetShadowColor(10, 10, 18) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 16.7109, -18.3754, -5.18197) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow2") AddShadowPlane(manny.hActor, "shadow3") SetActiveShadow(manny.hActor, 1) SetActorShadowPoint(manny.hActor, 16.7109, -18.3754, -5.18197) SetActorShadowPlane(manny.hActor, "shadow20") AddShadowPlane(manny.hActor, "shadow20") SetActiveShadow(manny.hActor, 2) SetActorShadowPoint(manny.hActor, 16.7109, -18.3754, -5.18197) SetActorShadowPlane(manny.hActor, "shadow21") AddShadowPlane(manny.hActor, "shadow21") end me.get_nitro = function(arg1) -- line 1054 break_here() si.nitrogen:get() end me.exit = function(arg1) -- line 1059 if sound_playing("mePump.imu") then stop_sound("mePump.imu") end if sound_playing("scaryMus.imu") then stop_sound("scaryMus.imu") end KillActorShadows(manny.hActor) stop_script(me.olivia_search_idles) end me.camerachange = function(arg1, arg2, arg3) -- line 1073 if arg3 == me_salcu and cutSceneLevel == 0 and not salvador.sprouted and manny.healed then me:salcu_setup() end if arg3 == me_shtgh then hector:set_visibility(TRUE) else hector:set_visibility(FALSE) end if me.sals_body.touchable then if arg3 == me_rerha then me.sals_body.act:set_visibility(TRUE) else me.sals_body.act:set_visibility(FALSE) end end if arg3 == me_carla and hector.dying then manny:say_line("/mema055/I can't leave until I know Hector is finished.") end if arg3 == me_pmpws then start_sfx("mePump.imu", IM_HIGH_PRIORITY, me.water_pump_vol) set_pan("mePump.imu", me.water_pump_pan) elseif sound_playing("mePump.imu") then fade_sfx("mePump.imu") end if arg3 == me_dorcu and me.hector_dying then start_sfx("scaryMus.imu") end music_state:update() end me.door_flowers = Object:create(me, "", 0, 0, 0, { range = 0 }) me.door_flowers:make_untouchable() me.door_flowers.here = function(arg1) -- line 1124 if not me.door_flowers.hObjectState then me.door_flowers.hObjectState = me:add_object_state(me_carla, "me_door_flowers.bm", "me_door_flowers.zbm", OBJSTATE_STATE, TRUE) me.door_flowers:set_object_state("me_door_flowers.cos") end SendObjectToFront(me.door_flowers.hObjectState) me.door_flowers:complete_chore(0) ForceRefresh() end me.darts = Object:create(me, "", 0, 0, 0, { range = 0 }) me.darts:make_untouchable() me.backdoor = Object:create(me, "", 0, 0, 0, { range = 0 }) me.brakeson = Object:create(me, "", 0, 0, 0, { range = 0 }) me.frontdoor = Object:create(me, "", 0, 0, 0, { range = 0 }) me.salflowers = Object:create(me, "", 0, 0, 0, { range = 0 }) me.salflowers.here = function(arg1) -- line 1143 arg1:complete_chore(0) box_off("flower_box1") box_off("flower_box2") box_off("flower_box3") box_off("flower_box4") break_here() me.door_flowers:here() end me.salflowers.haveTicket = function(arg1) -- line 1153 if not sals_ticket then sals_ticket = Actor:create() end sals_ticket:set_costume("tix.cos") sals_ticket:put_in_set(me) sals_ticket:ignore_boxes() sals_ticket:set_visibility(TRUE) sals_ticket:setpos(17.1435, -19.8446, -7.74288) sals_ticket:setrot(0, 0, 0) sals_ticket:play_chore_looping(0, "tix.cos") end me.salflowers.noTicket = function(arg1) -- line 1171 if not sals_ticket then sals_ticket = Actor:create() end sals_ticket:free() end me.leave_cu = { } me.leave_cu.walkOut = function(arg1) -- line 1177 me:current_setup(me_carla) manny:setpos(17.376, -20.0511, -7.8316) end me.return_trigger = { } me.return_trigger.walkOut = function(arg1) -- line 1185 if not manny.shot then start_script(me.pester_olivia) elseif not salvador.sprouted then start_script(me.setup_part2) elseif hi.ticket.owner == manny then start_script(me.ticket_radar) end end me.key = Object:create(me, "/metx043/trunk key", 0, 0, 0, { range = 0 }) me.key.string_name = "key" me.key.wav = "getmekey.wav" me.key.lookAt = function(arg1) -- line 1199 manny:say_line("/mema044/") end me.key.use = function(arg1) -- line 1203 manny:say_line("/mema045/") end me.key.default_response = me.key.use me.gun = Object:create(me, "/metx046/gun", 0, 0, 0, { range = 0 }) me.gun.wav = "fi_grbgn.wav" me.gun.lookAt = function(arg1) -- line 1211 manny:say_line("/fima074/") end me.gun.use = function(arg1) -- line 1215 if me:current_setup() == me_rerha then system.default_response("not here") elseif me:current_setup() == me_shtgh then single_start_script(me.shootout) else START_CUT_SCENE() manny:push_costume("md_shooting.cos") manny:stop_chore(md_activate_gun, "md.cos") manny:stop_chore(md_hold, "md.cos") manny:run_chore(md_shooting_pose, "md_shooting.cos") manny:say_line("/fima070/") manny:wait_for_message() manny:blend(md_shooting_pose_down, md_shooting_pose, 750, "md_shooting.cos") manny:say_line("/atma011/") start_script(manny.blend, manny, md_activate_gun, md_shooting_pose_down, 500, "md.cos", "md_shooting.cos") sleep_for(200) manny:play_chore(md_hold, "md.cos") manny:pop_costume() END_CUT_SCENE() end end me.gun.default_response = function(arg1) -- line 1239 manny:say_line("/fima071/") end me.gun.get = function(arg1) -- line 1243 me.setup_shootout() Object.get(me.gun) end me.suitcase = Object:create(me, "/metx047/suitcase", 18.7031, -19.8342, -7.7641602, { range = 0.60000002 }) me.suitcase.use_pnt_x = 18.479099 me.suitcase.use_pnt_y = -19.8132 me.suitcase.use_pnt_z = -7.8141599 me.suitcase.use_rot_x = 0 me.suitcase.use_rot_y = 262.80801 me.suitcase.use_rot_z = 0 me.suitcase:make_untouchable() me.suitcase.setUp = function(arg1) -- line 1269 if not arg1.act then arg1.act = Actor:create() end arg1.act:set_costume("ol_suitcase.cos") arg1.act:put_in_set(me) arg1.act:setpos(18.5508, -19.8835, -7.81814) arg1.act:setrot(0, 288.887, 0) arg1.act:play_chore(ol_suitcase_suitcase_closed) arg1:make_touchable() end me.suitcase.lookAt = function(arg1) -- line 1279 manny:say_line("/mema048/") end me.suitcase.pickUp = function(arg1) -- line 1283 manny:say_line("/mema049/") end me.suitcase.open = function(arg1) -- line 1287 arg1.act:play_chore(ol_suitcase_suitcase_open, "ol_suitcase.cos") end me.suitcase.use = function(arg1) -- line 1291 if manny:walkto_object(arg1) then START_CUT_SCENE() if not me.ticket_free then me.ticket_free = TRUE LoadCostume("tix_hop.cos") manny:walkto(arg1) manny:wait_for_actor() manny:play_chore(md_reach_low, "md.cos") sleep_for(1000) arg1:open() manny:wait_for_chore(md_reach_low, "md.cos") manny:stop_chore(md_reach_low, "md.cos", 500) manny:say_line("/lyma009/") wait_for_message() manny:say_line("/mnma043/") manny:play_chore(md_reach_low, "md.cos") sleep_for(1000) start_script(me.ticket.hop_out_of_suitcase) manny:complete_chore(md_activate_folded_scythe, "md.cos") me.scy:free() sleep_for(1000) manny:wait_for_chore(md_reach_low, "md.cos") manny:stop_chore(md_reach_low, "md.cos") manny:head_look_at(me.salvador_obj) manny:turn_toward_entity(me.salvador_obj) wait_for_script(me.ticket.hop_out_of_suitcase) manny:say_line("/mema050/") manny:fade_in_chore(md_putback_small, "md.cos", 750) sleep_for(750) manny:stop_chore(md_activate_folded_scythe, "md.cos") manny:wait_for_chore(md_putback_small, "md.cos") manny:stop_chore(md_putback_small, "md.cos") manny:run_chore(md_takeout_empty, "md.cos") manny:fade_out_chore(md_takeout_empty, "md.cos") mo.scythe:get() wait_for_message() manny:stop_chore() else manny:twist_head_gesture() manny:say_line("/mema051/") end END_CUT_SCENE() end end me.olivia_obj = Object:create(me, "/metx052/Olivia", 16.499001, -19.1306, -7.3317099, { range = 0.80000001 }) me.olivia_obj.use_pnt_x = 15.7885 me.olivia_obj.use_pnt_y = -19.087601 me.olivia_obj.use_pnt_z = -7.7867098 me.olivia_obj.use_rot_x = 0 me.olivia_obj.use_rot_y = -54.771801 me.olivia_obj.use_rot_z = 0 me.olivia_obj.behindCar = function(arg1) -- line 1352 me.olivia_obj.obj_x = 18.8026 me.olivia_obj.obj_y = -20.2137 me.olivia_obj.obj_z = -7.77 me.olivia_obj.use_pnt_x = 18.0926 me.olivia_obj.use_pnt_y = -20.2137 me.olivia_obj.use_pnt_z = -7.77 me.olivia_obj.use_rot_x = 0 me.olivia_obj.use_rot_y = 264.264 me.olivia_obj.use_rot_z = 0 arg1:update_look_point() end me.olivia_obj.lookAt = function(arg1) -- line 1365 manny:twist_head_gesture() end me.olivia_obj.pickUp = me.olivia_obj.lookAt me.olivia_obj.use = me.olivia_obj.lookAt me.car = Object:create(me, "/metx053/car", 18.214199, -19.6425, -7.36904, { range = 0.60000002 }) me.car.use_pnt_x = 18.4792 me.car.use_pnt_y = -19.8685 me.car.use_pnt_z = -7.81704 me.car.use_rot_x = 0 me.car.use_rot_y = 60.502602 me.car.use_rot_z = 0 me.car.lookAt = function(arg1) -- line 1379 manny:say_line("/mema054/") end me.car.setup = function(arg1) -- line 1383 if salvador.searched and not arg1.hObjectState then arg1.hObjectState = me:add_object_state(me_carla, "me_trunk.bm", nil, OBJSTATE_STATE, FALSE) arg1:set_object_state("me_trunk.cos") end end me.car.test = function(arg1) -- line 1390 me.setup_part3() me.pm() salvador.searched = TRUE me.car:setup() me.gun:free() manny:generic_pickup(me.key) me.car:play_chore(me_trunk_closed) end me.car.use = function(arg1) -- line 1400 if me.key.owner == manny then arg1:use_key() else START_CUT_SCENE() manny:walkto(arg1) manny:wait_for_actor() manny:run_chore(md_reach_med, "md.cos") manny:stop_chore(md_reach_med, "md.cos") END_CUT_SCENE() system.default_response("locked") end end me.car.use_key = function(arg1) -- line 1415 if me.gun.owner == manny then manny:say_line("/fima074/") elseif manny:walkto_object(arg1) then START_CUT_SCENE() manny:wait_for_actor() manny:stop_chore(nil, "md.cos") manny:play_chore(md_reach_med, "md.cos") sleep_for(300) start_sfx("me_keyin.wav") sleep_for(750) start_sfx("me_kytrn.wav") sleep_for(100) me.car:play_chore(me_trunk_open) sleep_for(750) manny:wait_for_chore(md_reach_med, "md.cos") manny:stop_chore(md_reach_med, "md.cos") manny:say_line("/mema056/") sleep_for(2000) manny:run_chore(md_use_obj) manny:stop_chore(md_use_obj) manny:play_chore(md_reach_high, "md.cos") sleep_for(1000) me.car:play_chore(me_trunk_close) manny:wait_for_chore(md_reach_high, "md.cos") manny:stop_chore(md_reach_high, "md.cos") me.key:put_in_limbo() manny.is_holding = nil manny:generic_pickup(me.gun) manny:turn_left(150) manny:head_look_at(nil) sleep_for(500) me.gun:use() END_CUT_SCENE() me.setup_shootout() end end me.car.pickUp = function(arg1) -- line 1454 system.default_response("tow") end me.greenhouse = Object:create(me, "/metx057/greenhouse", -0.130422, -0.047307599, 2.8800001, { range = 10 }) me.greenhouse.use_pnt_x = 4.7495799 me.greenhouse.use_pnt_y = -3.86731 me.greenhouse.use_pnt_z = -2 me.greenhouse.use_rot_x = 0 me.greenhouse.use_rot_y = 398.32401 me.greenhouse.use_rot_z = 0 me.greenhouse.lookAt = function(arg1) -- line 1467 if hector.dying then me.door:lookAt() elseif not me.shootout_begun then manny:say_line("/mema058/") else manny:say_line("/mema059/") end end me.greenhouse.use = function(arg1) -- line 1479 me.door:use() end me.greenhouse.use_gun = function(arg1) -- line 1483 me.gun:use() end me.door = Object:create(me, "/metx060/door", -0.025450001, -1.9213001, 0.49643999, { range = 0.60000002 }) me.door.use_pnt_x = -0.025450001 me.door.use_pnt_y = -2.2802999 me.door.use_pnt_z = -0.0022370601 me.door.use_rot_x = 0 me.door.use_rot_y = 326.013 me.door.use_rot_z = 0 me.door.lookAt = function(arg1) -- line 1496 if not hector.dying then manny:say_line("/mema061/") else manny:say_line("/mema062/") end end me.door.use = function(arg1) -- line 1504 if me.hector_dying == TRUE then if manny:walkto_object(arg1) then start_script(me.blow_hector_up) end elseif not manny.shot then if manny:walkto_object(arg1) then START_CUT_SCENE() me:current_setup(me_dorcu) manny:push_costume("md_green_door.cos") if manny.is_holding == me.gun then manny:complete_chore(md_green_door_show_gun, "md_green_door.cos") else manny:complete_chore(md_green_door_hide_gun, "md_green_door.cos") end manny:run_chore(md_green_door_touch_knob, "md_green_door.cos") END_CUT_SCENE() stop_script(hector.part_1_idle) me.greenhouse_approach_music = FALSE start_script(cut_scene.greenhse) end else soft_script() if me.gun.owner ~= manny then manny:say_line("/mema063/") else manny:say_line("/mema064/") wait_for_message() manny:say_line("/mema065/") end end end me.door.use_gun = me.door.use me.tanks = Object:create(me, "/metx066/tanks", -3.50053, -15.7738, -5.7848601, { range = 1.2 }) me.tanks.use_pnt_x = -3.01353 me.tanks.use_pnt_y = -15.3618 me.tanks.use_pnt_z = -6.4458599 me.tanks.use_rot_x = 0 me.tanks.use_rot_y = 111.67 me.tanks.use_rot_z = 0 me.tanks.lookAt = function(arg1) -- line 1551 soft_script() manny:say_line("/mema067/") wait_for_message() manny:say_line("/mema068/") end me.tanks.pickUp = function(arg1) -- line 1558 system.default_response("right") end me.tanks.use = function(arg1) -- line 1562 manny:say_line("/mema069/") end me.tanks.use_gun = function(arg1) -- line 1566 if me.hector_dying then system.default_response("already") elseif manny:walkto(arg1) then start_script(me.kill_hector) end end me.salvador_obj = Object:create(me, "/hitx018/Salvador's head", 17.8153, -19.1085, -7.50105, { range = 0.89999998 }) me.salvador_obj.use_pnt_x = 17.6513 me.salvador_obj.use_pnt_y = -19.4725 me.salvador_obj.use_pnt_z = -7.7960501 me.salvador_obj.use_rot_x = 0 me.salvador_obj.use_rot_y = -25.660601 me.salvador_obj.use_rot_z = 0 me.salvador_obj.onGround = function(arg1) -- line 1585 me.salvador_obj.obj_x = 17.0943 me.salvador_obj.obj_y = -19.7879 me.salvador_obj.obj_z = -7.85808 me.salvador_obj.use_pnt_x = 17.2323 me.salvador_obj.use_pnt_y = -19.8669 me.salvador_obj.use_pnt_z = -7.85808 me.salvador_obj.use_rot_x = 0 me.salvador_obj.use_rot_y = 778.924 me.salvador_obj.use_rot_z = 0 arg1:update_look_point() end me.salvador_obj.lookAt = function(arg1) -- line 1599 if me.ticket_free and not me.plucked_ticket then manny:say_line("/hima019/") else manny:say_line("/hima020/") if not salvador.sprouted then arg1:wakeUp() end end end me.salvador_obj.wakeUp = function(arg1) -- line 1610 if not salvador.sprouted then START_CUT_SCENE() wait_for_message() END_CUT_SCENE() single_start_script(me.salvador_goodbye) end end me.salvador_obj.pickUp = function(arg1) -- line 1619 if me.ticket_free and not me.plucked_ticket then START_CUT_SCENE() manny:walkto(arg1) manny:wait_for_actor() manny:play_chore(md_reach_low, "md.cos") me.salflowers:noTicket() me.plucked_ticket = TRUE me.ticket.active = TRUE manny:generic_pickup(me.ticket) manny:wait_for_chore(md_reach_low, "md.cos") manny:stop_chore(md_reach_low, "md.cos") me.ticket:dormant() manny:setrot(0, 1.07562, 0) manny:backup(750) start_script(me.sal_detector) END_CUT_SCENE() elseif salvador.sprouted then manny:say_line("/rema065/") else manny:say_line("/hima021/") arg1:wakeUp() end end me.salvador_obj.use = function(arg1) -- line 1646 if salvador.sprouted then arg1:pickUp() else START_CUT_SCENE() manny:say_line("/lwma014/") manny:wait_for_message() END_CUT_SCENE() single_start_script(me.salvador_goodbye) end end me.sals_body = Object:create(me, "/metx099/Salvador's body", -0.69341803, 2.9798601, -0.47968701, { range = 0.60000002 }) me.sals_body.use_pnt_x = -0.55507398 me.sals_body.use_pnt_y = 2.74944 me.sals_body.use_pnt_z = -0.413986 me.sals_body.use_rot_x = 0 me.sals_body.use_rot_y = 28.913 me.sals_body.use_rot_z = 0 me.sals_body.touchable = FALSE me.sals_body.setup = function(arg1) -- line 1674 if sals_ticket then sals_ticket:free() end if not arg1.act then arg1.act = Actor:create() end arg1.act:put_in_set(me) arg1.act:setpos(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z - 0.09) arg1.act:setrot(0, 0, 0) arg1.act:set_costume("sal_dead.cos") arg1.act:play_chore(0) arg1:make_touchable() end me.sals_body.lookAt = function(arg1) -- line 1685 if salvador.searched then arg1:use() else manny:say_line("/sgma053/") end end me.sals_body.pickUp = function(arg1) -- line 1693 manny:say_line("/rema065/") end me.sals_body.use = function(arg1) -- line 1697 if salvador.searched then manny:say_line("/sima098/") elseif manny:walkto_object(arg1) then me:search_salvador() end end me.ticket = Object:create(me, "/hitx022/Double-N ticket", 0, 0, 0, { range = 0 }) me.ticket.wav = "getCard.wav" me.ticket.string_name = "ticket" me.ticket.lookAt = function(arg1) -- line 1713 if arg1.owner == manny then if arg1.active then if arg1.activator == me.salvador_obj then manny:say_line("/hima019/") else manny:say_line("/hima024/") end else manny:say_line("/hima025/") end else manny:say_line("/hima023/") end end me.ticket.use = me.ticket.lookAt me.ticket.hop_out_of_suitcase = function(arg1) -- line 1731 if not sals_ticket then sals_ticket = Actor:create() end sals_ticket:set_costume("tix_hop.cos") sals_ticket:setpos(18.6235, -20.0066, -7.61188) sals_ticket:setrot(351.075, 182.103, 103.151) sals_ticket:put_in_set(me) sals_ticket:play_chore(0) sals_ticket:wait_for_chore(0) me.salflowers:haveTicket() end me.ticket.activated = function(arg1, arg2) -- line 1742 arg1.activator = arg2 if not arg1.active or arg1.to_update then arg1.active = TRUE arg1.to_update = FALSE manny:stop_chore(md_hold, "md.cos") manny:stop_chore(md_activate_tix_nowig, "md.cos") manny:play_chore_looping(md_activate_ticket, "md.cos") manny:play_chore(md_hand_on_obj, "md.cos") start_script(me.ticket.sound_monitor, me.ticket) end end me.ticket.sound_monitor = function(arg1) -- line 1755 local local1, local2, local3 single_start_sfx("tixvibe.imu", nil, 0) PrintDebug("starting sfx!\n") fade_sfx("tixvibe.imu", 500, 60) while 1 do local1 = object_proximity(me.salvador_obj) local2 = object_proximity(me.sals_body) if local1 > local2 then local1 = local2 end if local1 < 1 then local1 = 1 end local3 = 4 * 35 / local1 if local3 > 64 then local3 = 64 end if local3 < 5 then local3 = 5 end set_vol("tixvibe.imu", local3) break_here() end end me.ticket.dormant = function(arg1) -- line 1777 arg1.activator = nil if arg1.active or arg1.to_update then arg1.active = FALSE arg1.to_update = FALSE stop_script(me.ticket.sound_monitor) PrintDebug("stopping sfx!\n") fade_sfx("tixvibe.imu") manny:stop_chore(md_hand_on_obj, "md.cos") manny:stop_chore(md_activate_ticket, "md.cos") manny:play_chore_looping(md_hold, "md.cos") manny:play_chore_looping(md_activate_tix_nowig, "md.cos") end end me.ticket.takeout_flag = function(arg1) -- line 1792 PrintDebug("starting sal_detector!\n") single_start_script(me.sal_detector) wait_for_script(close_inventory) arg1.to_update = TRUE end me.ticket.putback_flag = function(arg1) -- line 1799 PrintDebug("stopping sal_detector!\n") stop_script(me.sal_detector) stop_script(me.ticket.sound_monitor) fade_sfx("tixvibe.imu") manny:stop_chore(md_activate_tix_nowig, "md.cos") manny:stop_chore(md_hand_on_obj, "md.cos") manny:play_chore_looping(md_activate_ticket, "md.cos") end CheckFirstTime("ly.lua") dofile("br_idles.lua") dofile("cc_taplook.lua") dofile("cc_play_slot.lua") dofile("meche_seduction.lua") dofile("cc_seduction.lua") dofile("unicycle_man.lua") dofile("ly_slot_door.lua") dofile("msb_msb_sheet.lua") dofile("meche_ruba.lua") dofile("cc_toga.lua") dofile("mi_with_cc_toga.lua") dofile("ly_cc_sheet.lua") ly = Set:create("ly.set", "le mans lobby", { ly_top = 0, ly_intha = 1, ly_intha1 = 1, ly_intha2 = 1, ly_intha3 = 1, ly_intha4 = 1, ly_intha5 = 1, ly_intha6 = 1, ly_intha7 = 1, ly_sltha = 2, ly_chaws = 3, ly_elems = 4, ly_kenla = 5, ly_lavha = 6 }) ly.unicycle_roll_min_vol = 5 ly.unicycle_roll_max_vol = 20 slot_wheel = { parent = Actor } slot_wheel.pitch = { } slot_wheel.pitch[1] = { 30, 105, 175, 280 } slot_wheel.pitch[2] = { 140, 210, 315 } slot_wheel.pitch[3] = { 65, 245 } slot_wheel.pitch[4] = { 350 } slot_wheel.create = function(arg1) -- line 42 local local1 local local2 local1 = Actor:create(nil, nil, nil, "slot wheel") local1.parent = arg1 local2 = rndint(1, 4) local1.cur_pitch = arg1.pitch[local2][1] local1.slot = FALSE return local1 end slot_wheel.default = function(arg1) -- line 55 arg1:set_costume("ly_slotwheel.cos") arg1:put_in_set(ly) arg1:setrot(arg1.cur_pitch, 270, 90) end slot_wheel.spin = function(arg1) -- line 61 local local1 local local2 local local3 local local4 = { "ly_wlsp1.WAV", "ly_wlsp2.WAV", "ly_wlsp3.WAV" } local2 = arg1:get_positive_rot() local1 = 10 arg1.slot = nil while arg1.slot == nil do arg1:setrot(arg1.cur_pitch, local2.y, local2.z) arg1.cur_pitch = arg1.cur_pitch - local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end if local1 < 60 then local1 = local1 + 1 end break_here() end local3 = FALSE while not local3 do if local1 > 5 then local1 = local1 - 1 end arg1.cur_pitch = arg1.cur_pitch + local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end arg1:setrot(arg1.cur_pitch, local2.y, local2.z) if arg1:check_match() then local3 = TRUE else break_here() end end arg1:play_sound_at(pick_one_of(local4, TRUE)) end slot_wheel.scramble_to_win = function(arg1) -- line 107 local local1 local local2, local3 arg1.slot = 4 local2 = arg1:get_positive_rot() if rnd(5) then local1 = 5 else local1 = -5 end local3 = FALSE arg1.cur_pitch = local2.x while not local3 do arg1.cur_pitch = arg1.cur_pitch + local1 if arg1.cur_pitch < 0 then arg1.cur_pitch = arg1.cur_pitch + 360 end if arg1.cur_pitch > 360 then arg1.cur_pitch = arg1.cur_pitch - 360 end arg1:setrot(arg1.cur_pitch, local2.y, local2.z) if arg1:check_match() then local3 = TRUE else break_here() end end end slot_wheel.check_match = function(arg1) -- line 137 local local1, local2 local local3 local3 = FALSE local1, local2 = next(arg1.pitch[arg1.slot], nil) while local1 and not local3 do if abs(local2 - arg1.cur_pitch) < 5 then local3 = TRUE end local1, local2 = next(arg1.pitch[arg1.slot], local1) end return local3 end slot_machine = { } slot_machine.create = function(arg1) -- line 156 local local1 local1 = { } local1.parent = arg1 local1.actors = { } local1.pos = { } local1.rot = nil local1.spinning = FALSE return local1 end slot_machine.create_wheels = function(arg1) -- line 169 local local1 if not arg1.actors then arg1.actors = { } end local1 = 1 while local1 <= 3 do if not arg1.actors[local1] then arg1.actors[local1] = slot_wheel:create() end local1 = local1 + 1 end end slot_machine.free = function(arg1) -- line 185 if arg1.actors then if arg1.actors[1] then arg1.actors[1]:free() end if arg1.actors[2] then arg1.actors[2]:free() end if arg1.actors[3] then arg1.actors[3]:free() end end arg1.actors = nil end slot_machine.default = function(arg1) -- line 200 local local1 arg1:create_wheels() local1 = 1 while local1 <= 3 do arg1.actors[local1]:default() arg1.actors[local1]:setpos(arg1.pos[local1].x, arg1.pos[local1].y, arg1.pos[local1].z) if arg1.rot then arg1.actors[local1]:setrot(arg1.rot.x, arg1.rot.y, arg1.rot.z) end local1 = local1 + 1 end end slot_machine.spin = function(arg1) -- line 216 arg1.spin_scripts = { } arg1.spinning = TRUE arg1.wheel_sound = arg1.actors[1]:play_sound_at("ly_wheel.IMU", 10, 80) arg1.spin_scripts[1] = start_script(arg1.actors[1].spin, arg1.actors[1]) break_here() arg1.spin_scripts[2] = start_script(arg1.actors[2].spin, arg1.actors[2]) break_here() arg1.spin_scripts[3] = start_script(arg1.actors[3].spin, arg1.actors[3]) end slot_machine.scramble_to_win = function(arg1) -- line 229 local local1, local2, local3 local1 = start_script(arg1.actors[1].scramble_to_win, arg1.actors[1]) local2 = start_script(arg1.actors[2].scramble_to_win, arg1.actors[2]) local3 = start_script(arg1.actors[3].scramble_to_win, arg1.actors[3]) wait_for_script(local1) wait_for_script(local2) wait_for_script(local3) end slot_machine.stop = function(arg1, arg2) -- line 239 local local1 local local2 if arg1.spinning then local1 = FALSE local2 = { } repeat local2[1] = rndint(1, 4) local2[2] = rndint(1, 4) local2[3] = rndint(1, 4) if not arg2 then if local2[1] == local2[2] and local2[2] == local2[3] then local1 = FALSE else local1 = TRUE end elseif local2[1] == local2[2] and local2[2] == local2[3] then local1 = TRUE else local1 = FALSE end if not local1 then break_here() end until local1 arg1.actors[1].slot = local2[1] if arg1.spin_scripts[1] then wait_for_script(arg1.spin_scripts[1]) end sleep_for(100) arg1.actors[2].slot = local2[2] if arg1.spin_scripts[2] then wait_for_script(arg1.spin_scripts[2]) end sleep_for(100) arg1.actors[3].slot = local2[3] if arg1.spin_scripts[3] then wait_for_script(arg1.spin_scripts[3]) end end arg1.spinning = FALSE stop_sound("ly_wheel.IMU") arg1.spin_scripts = nil end slot_machine.freeze = function(arg1) -- line 295 arg1.actors[1]:freeze() arg1.actors[2]:freeze() arg1.actors[3]:freeze() end slot_machine.thaw = function(arg1, arg2) -- line 301 arg1.actors[1]:thaw(arg2) arg1.actors[2]:thaw(arg2) arg1.actors[3]:thaw(arg2) end ly.slot_handle = { } ly.slot_handle.parent = Actor ly.slot_handle.create = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) -- line 312 local local1 local1 = Actor:create(nil, nil, nil, "handle") local1.parent = ly.slot_handle if arg2 then local1.pos = { } local1.pos.x = arg2 local1.pos.y = arg3 local1.pos.z = arg4 end if arg5 then local1.rot = { } local1.rot.x = arg5 local1.rot.y = arg6 local1.rot.z = arg7 end return local1 end ly.slot_handle.default = function(arg1) -- line 333 arg1:put_in_set(ly) arg1:set_costume("ly_slothandle.cos") arg1:play_chore(1) if arg1.pos then arg1:setpos(arg1.pos.x, arg1.pos.y, arg1.pos.z) end if arg1.rot then arg1:setrot(arg1.rot.x, arg1.rot.y, arg1.rot.z) end end ly.slot_handle.init = function(arg1) -- line 345 if not arg1[1] then arg1[1] = ly.slot_handle:create(0.63847, 0.401519, 0.006, 0, 0, 0) end if not arg1[2] then arg1[2] = ly.slot_handle:create(1.05447, 0.401519, 0.006, 0, 0, 0) end if not arg1[3] then arg1[3] = ly.slot_handle:create(1.82115, -0.135567, 0.015, 0, 270, 0) end if not arg1[4] then arg1[4] = ly.slot_handle:create(1.82285, -0.541493, 0.013, 0, 270, 0) end arg1[1]:default() arg1[2]:default() arg1[3]:default() arg1[4]:default() arg1[4]:set_visibility(FALSE) arg1[1]:freeze() arg1[2]:freeze() end ly.slot_handle.free = function(arg1) -- line 369 if arg1[1] then arg1[1]:free() end if arg1[2] then arg1[2]:free() end if arg1[3] then arg1[3]:free() end end charlies_slot = slot_machine:create() charlies_slot.pos[1] = { x = 2.1475301, y = -0.416738, z = 0.44400001 } charlies_slot.pos[2] = { x = 2.1475301, y = -0.492737, z = 0.44400001 } charlies_slot.pos[3] = { x = 2.1475301, y = -0.569736, z = 0.44400001 } mannys_slot = slot_machine:create() mannys_slot.pos[1] = { x = 2.1358399, y = -0.0144972, z = 0.44499999 } mannys_slot.pos[2] = { x = 2.1358399, y = -0.0924972, z = 0.44499999 } mannys_slot.pos[3] = { x = 2.1358399, y = -0.169497, z = 0.44499999 } ly.keno_actor = Actor:create(nil, nil, nil, "keno board") ly.keno_actor.current_number = nil ly.keno_actor.current_game = nil ly.keno_actor.game_index = 1 ly.keno_actor.game_paused = FALSE ly.keno_actor.default = function(arg1) -- line 417 arg1:set_costume("ly_keno.cos") arg1:put_in_set(ly) arg1:setpos(-0.0558433, -0.0978411, 2.801) arg1:set_visibility(TRUE) end ly.keno_actor.game = function(arg1) -- line 424 while TRUE do arg1:clear_game() while arg1.game_index < 10 do if not arg1.game_paused then arg1:choose_number() end sleep_for(15000) end break_here() end end ly.keno_actor.clear_game = function(arg1) -- line 437 arg1.current_game = { } arg1.game_index = 0 arg1.current_number = nil arg1:complete_chore(32) end ly.keno_actor.choose_number = function(arg1) -- line 444 local local1, local2 local2 = TRUE while local2 do local1 = rndint(1, 32) if not arg1:find_number(local1) then local2 = FALSE else break_here() end end arg1.game_index = arg1.game_index + 1 arg1.current_game[arg1.game_index] = local1 arg1.current_number = local1 arg1:complete_chore(local1 - 1) arg1:play_sound_at("ly_keno.wav", 10, 70) end ly.keno_actor.find_number = function(arg1, arg2) -- line 463 local local1, local2 local2 = FALSE local1 = 1 while local1 <= arg1.game_index and not local2 do if arg1.current_game[local1] == arg2 then local2 = TRUE end local1 = local1 + 1 end return local2 end unicycle_man.point = { } unicycle_man.point[0] = { } unicycle_man.point[0].pos = { x = 0.89800102, y = 0.39131901, z = 0 } unicycle_man.point[0].rot = { x = 0, y = 0, z = 0 } unicycle_man.point[1] = { } unicycle_man.point[1].pos = { x = 0.49000099, y = 0.394319, z = 0 } unicycle_man.point[1].rot = { x = 0, y = 0, z = 0 } unicycle_man.point.mid = { } unicycle_man.point["mid"].pos = { x = 0.74000102, y = 0.090319097, z = 0 } unicycle_man.point["mid"].rot = { x = 0, y = 0, z = 0 } unicycle_man.point.charlie = { } unicycle_man.point["charlie"].pos = { x = 1.84929, y = -0.39064199, z = 0 } unicycle_man.point["charlie"].rot = { x = 0, y = 270.01999, z = 0 } unicycle_man.cur_point = 0 unicycle_man.save_pos = function(arg1) -- line 499 arg1.current_pos = arg1:getpos() arg1.current_rot = arg1:getrot() end unicycle_man.restore_pos = function(arg1) -- line 504 local local1 if arg1.current_pos then arg1:setpos(arg1.current_pos.x, arg1.current_pos.y, arg1.current_pos.z) arg1:setrot(arg1.current_rot.x, arg1.current_rot.y, arg1.current_rot.z) else local1 = arg1.point[arg1.cur_point] arg1:setpos(local1.pos.x, local1.pos.y, local1.pos.z) arg1:setrot(local1.rot.x, local1.rot.y, local1.rot.z) end end unicycle_man.cycle_to = function(arg1, arg2, arg3) -- line 517 local local1 local1 = GetActorYawToPoint(arg1.hActor, arg1.point.mid.pos) local1 = local1 + 180 arg1:set_turn_rate(120) if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end arg1:setrot(0, local1, 0, TRUE) arg1:stop_chore(unicycle_man_idles) arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(-0.30000001) while proximity(arg1.hActor, arg1.point.mid.pos.x, arg1.point.mid.pos.y, arg1.point.mid.pos.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end local1 = GetActorYawToPoint(arg1.hActor, arg2) arg1:stop_chore(unicycle_man_roll) arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(0, local1, 0, TRUE) arg1:wait_for_actor() arg1:stop_chore(unicycle_man_idles) arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(0.30000001) while proximity(arg1.hActor, arg2.x, arg2.y, arg2.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end arg1:setpos(arg2.x, arg2.y, arg2.z) arg1:stop_chore(unicycle_man_roll) stop_sound("um_roll.IMU") arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(arg3.x, arg3.y, arg3.z, TRUE) end unicycle_man.cycle_straight_to = function(arg1, arg2, arg3) -- line 564 local local1 local1 = GetActorYawToPoint(arg1.hActor, arg2) arg1:set_turn_rate(120) arg1:stop_chore(unicycle_man_idles) if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end arg1:play_chore_looping(unicycle_man_roll) arg1:set_walk_rate(0.30000001) arg1:setrot(0, local1, 0, TRUE) while proximity(arg1.hActor, arg2.x, arg2.y, arg2.z) > 0.1 do WalkActorForward(arg1.hActor) break_here() end arg1:setpos(arg2.x, arg2.y, arg2.z) arg1:stop_chore(unicycle_man_roll) stop_sound("um_roll.IMU") arg1:play_chore_looping(unicycle_man_idles) arg1:setrot(arg3.x, arg3.y, arg3.z, TRUE) end unicycle_man.turn_to_manny = function(arg1) -- line 591 local local1, local2 local2 = manny:getpos() if not sound_playing("um_roll.IMU") then arg1:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end local1 = GetActorYawToPoint(arg1.hActor, local2) arg1:setrot(0, local1, 0, TRUE) arg1:wait_for_actor() stop_sound("um_roll.IMU") end ly.agent_talk_count = 0 ly.talk_to_agent = function(arg1) -- line 610 local local1 = TRUE local local2 = FALSE local local3, local4 START_CUT_SCENE() start_script(ly.unicycle_stop_idles, ly) manny:set_collision_mode(COLLISION_OFF) ly.agent_talk_count = ly.agent_talk_count + 1 if ly.agent_talk_count == 1 then ly.met_agent = TRUE manny:say_line("/lyma066/") manny:wait_for_message() unicycle_man:say_line("/lyum067/") unicycle_man:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:say_line("/lyum068/") unicycle_man:wait_for_message() local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) manny:tilt_head_gesture(TRUE) manny:point_gesture(TRUE) manny:say_line("/lyma069/") manny:wait_for_message() unicycle_man:say_line("/lyum070/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum071/") unicycle_man:wait_for_message() elseif ly.agent_talk_count == 2 then manny:say_line("/lyma072/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) unicycle_man:say_line("/lyum073/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum074/") unicycle_man:wait_for_message() manny:say_line("/lyma075/") elseif ly.meche_talk_count < 2 then manny:say_line("/lyma076/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) local3 = unicycle_man:getpos() local4 = GetActorYawToPoint(manny.hActor, local3) manny:setrot(0, local4, 0, TRUE) ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:turn_to_manny() unicycle_man:say_line("/lyum077/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum078/") unicycle_man:wait_for_message() local2 = TRUE elseif not ly.charlie_on_floor then manny:say_line("/lyma079/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) ly:track_unicycle_man() manny:head_look_at(ly.unicycle_man) unicycle_man:turn_to_manny() unicycle_man:say_line("/lyum080/") unicycle_man:wait_for_message() unicycle_man:say_line("/lyum081/") unicycle_man:wait_for_message() else local1 = FALSE start_script(ly.charlies_jackpot) end END_CUT_SCENE() manny:set_collision_mode(COLLISION_OFF) if local1 then start_script(ly.unicycle_idles, ly, local2) end end ly.unicycle_idles = function(arg1, arg2) -- line 708 local local1, local2 unicycle_man.in_machine = FALSE unicycle_man.rolling = FALSE while TRUE do break_here() ly:track_unicycle_man() if not arg2 then local1 = unicycle_man.cur_point + 1 if not unicycle_man.point[local1] then local1 = 0 end unicycle_man.cur_point = local1 unicycle_man.rolling = TRUE start_script(unicycle_man.cycle_to, unicycle_man, unicycle_man.point[local1].pos, unicycle_man.point[local1].rot) while find_script(unicycle_man.cycle_to) do break_here() ly:track_unicycle_man() end unicycle_man.rolling = FALSE sleep_for(10000) else local1 = unicycle_man.cur_point unicycle_man:setrot(unicycle_man.point[local1].rot.x, unicycle_man.point[local1].rot.y, unicycle_man.point[local1].rot.z, TRUE) unicycle_man:wait_for_actor() end unicycle_man:set_chore_looping(unicycle_man_idles, FALSE) unicycle_man:wait_for_chore(unicycle_man_idles) unicycle_man.in_machine = TRUE unicycle_man:run_chore(unicycle_man_crawl_slot) start_script(ly.unicycle_slot_sfx) sleep_for(rndint(6000, 9000)) unicycle_man:play_sound_at("ly_pyoff.IMU", 80, 110) unicycle_man:run_chore(unicycle_man_out_slot) fade_sfx("ly_pyoff.IMU", 200) unicycle_man:play_chore_looping(unicycle_man_idles) unicycle_man.in_machine = FALSE sleep_for(10000) end end ly.unicycle_stop_idles = function(arg1) -- line 762 stop_sound("ly_pyoff.IMU") stop_script(ly.unicycle_idles) if unicycle_man.rolling then while find_script(unicycle_man.cycle_to) do break_here() ly:track_unicycle_man() end unicycle_man.rolling = FALSE elseif unicycle_man.in_machine then if unicycle_man:is_choring(unicycle_man_crawl_slot) then unicycle_man:wait_for_chore(unicycle_man_crawl_slot) unicycle_man:run_chore(unicycle_man_out_slot) elseif unicycle_man:is_choring(unicycle_man_out_slot) then unicycle_man:wait_for_chore(unicycle_man_out_slot) else unicycle_man:run_chore(unicycle_man_out_slot) end end unicycle_man:play_chore_looping(unicycle_man_idles) end ly.track_unicycle_man = function(arg1) -- line 788 local local1 local1 = unicycle_man:getpos() ly.unicycle_man.obj_x = local1.x ly.unicycle_man.obj_y = local1.y ly.unicycle_man.obj_z = local1.z + 0.40000001 ly.unicycle_man.interest_actor:put_in_set(ly) ly.unicycle_man.interest_actor:setpos(ly.unicycle_man.obj_x, ly.unicycle_man.obj_y, ly.unicycle_man.obj_z) if hot_object == ly.unicycle_man then system.currentActor:head_look_at(ly.unicycle_man) end end ly.unicycle_slot_sfx = function(arg1) -- line 802 local local1 = { "um_swit1.wav", "um_swit2.wav", "um_swit3.wav" } sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) sleep_for(rndint(1000, 2000)) unicycle_man:play_sound_at(pick_one_of(local1, TRUE), 100, 127) end ly.brennis_idle_table = Idle:create("br_idles") idt = ly.brennis_idle_table idt:add_state("rest", { rest = 0.97000003, looks = 0.0099999998, moves_head = 0.0099999998, scrtch_chst = 0.0099999998 }) idt:add_state("looks", { rest = 1 }) idt:add_state("moves_head", { rest = 1 }) idt:add_state("scrtch_chst", { rest = 1 }) ly.brennis_talk_count = 0 ly.brennis_stop_idle = function(arg1) -- line 830 stop_script(brennis.ly_idle_script) brennis.ly_idle_script = nil brennis:wait_for_chore() brennis:play_chore(br_idles_rest) end ly.brennis_start_idle = function(arg1) -- line 837 brennis:stop_chore() brennis.ly_idle_script = start_script(brennis.new_run_idle, brennis, "rest", ly.brennis_idle_table, "br_idles.cos") end ly.talk_clothes_with_brennis = function(arg1) -- line 842 START_CUT_SCENE() ly.brennis_talk_count = ly.brennis_talk_count + 1 start_script(ly.brennis_stop_idle, ly) if ly.brennis_talk_count == 1 then ly:current_setup(ly_kenla) sleep_for(1500) manny:tilt_head_gesture() manny:say_line("/lyma012/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_bar_door, "br_idles.cos") brennis:say_line("/lybs013/") brennis:wait_for_message() brennis:say_line("/lybs014/") elseif ly.brennis_talk_count == 2 then ly:current_setup(ly_kenla) manny:shrug_gesture() manny:say_line("/lyma015/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_scrtch_chst, "br_idles.cos") brennis:say_line("/lybs016/") brennis:wait_for_message() ly:current_setup(ly_kenla) manny:say_line("/lyma017/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs018/") elseif ly.brennis_talk_count == 3 then ly:current_setup(ly_kenla) manny:hand_gesture() manny:say_line("/lyma019/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs020/") brennis:wait_for_message() brennis:say_line("/lybs021/") brennis:wait_for_message() brennis:say_line("/lybs022/") brennis:wait_for_message() elseif ly.brennis_talk_count == 4 then ly:current_setup(ly_kenla) manny:hand_gesture() manny:say_line("/lyma023/") manny:wait_for_message() manny:tilt_head_gesture() manny:say_line("/lyma024/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:play_chore(br_idles_bar_door, "br_idles.cos") brennis:say_line("/lybs025/") brennis:wait_for_message() brennis:say_line("/lybs026/") brennis:wait_for_chore(br_idles_bar_door, "br_idles.cos") elseif ly.brennis_talk_count == 5 then ly:current_setup(ly_kenla) manny:point_gesture() manny:say_line("/lyma027/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs028/") brennis:wait_for_message() brennis:say_line("/lybs029/") brennis:wait_for_message() brennis:say_line("/lybs030/") brennis:wait_for_message() ly:current_setup(ly_kenla) manny:say_line("/lyma031/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs032/") else ly:current_setup(ly_kenla) manny:twist_head_gesture() manny:say_line("/lyma033/") manny:wait_for_message() ly:current_setup(ly_elems) brennis:say_line("/lybs034/") end END_CUT_SCENE() brennis:wait_for_chore() ly:brennis_start_idle() end ly.meche_talk_count = 0 ly.gun_control = function() -- line 947 while TRUE do break_here() if manny.is_holding == fi.gun and system.currentSet == ly then START_CUT_SCENE() wait_for_script(open_inventory) wait_for_script(close_inventory) manny:clear_hands() manny:say_line("/lyma003/") manny:wait_for_message() manny:say_line("/lyma004/") END_CUT_SCENE() end end end ly.playslots = function(arg1, arg2) -- line 963 START_CUT_SCENE() manny:walkto(1.8283, -0.263458, 0, 0, 292.582, 0) manny:wait_for_actor() manny:head_look_at(nil) ly.slot_handle[3]:thaw(TRUE) mannys_slot:thaw(TRUE) ly.slot_handle[3]:play_chore(0) sleep_for(50) manny:play_chore(msb_reach_cabinet, manny.base_costume) sleep_for(500) mannys_slot:spin() sleep_for(500) manny:head_look_at(ly.slot1) if not ly.played then ly.played = TRUE manny:say_line("/lyma006/") wait_for_message() manny:say_line("/lyma007/") wait_for_message() end manny:wait_for_chore(msb_reach_cabinet, manny.base_costume) manny:stop_chore(msb_reach_cabinet, manny.base_costume) manny:head_look_at(ly.slot1) ly.slot_handle[3]:wait_for_chore(0) ly.slot_handle[3]:freeze() if rnd() then mannys_slot:stop(FALSE) if not ly.lost then ly.lost = TRUE manny:say_line("/lyma008/") end else mannys_slot:stop(TRUE) manny:say_line("/lyma009/") if not ly.won then ly.won = TRUE manny:wait_for_message() manny:head_look_at_point(1.89026, -0.0954438, 0) manny:say_line("/lyma010/") manny:wait_for_message() manny:say_line("/lyma011/") end end END_CUT_SCENE() manny:head_look_at(nil) mannys_slot:freeze() end ly.talk_clothes_with_meche = function(arg1) -- line 1019 START_CUT_SCENE() if ly.charlie_on_floor then meche:say_line("/lymc005/") else ly.meche_talk_count = ly.meche_talk_count + 1 if ly.meche_talk_count == 1 then single_start_script(ly.seduce_charlie, ly) manny:say_line("/lyma035/") manny:wait_for_message() meche:say_line("/lymc036/") elseif ly.meche_talk_count == 2 then manny:walkto_object(ly.meche_obj) manny:wait_for_actor() if find_script(ly.seduce_charlie) and ly.meche_obj.touchable then stop_script(ly.seduce_charlie) end manny:say_line("/lyma037/") manny:wait_for_message() while not ly.meche_obj.touchable do break_here() end meche:say_line("/lymc038/") meche:wait_for_message() meche:say_line("/lymc039/") meche:wait_for_message() meche:say_line("/lymc040/") ly:manny_take_sheet_from_meche() elseif ly.meche_talk_count == 3 then manny:say_line("/lyma041/") manny:wait_for_message() meche:say_line("/lymc042/") meche:wait_for_message() meche:say_line("/lymc043/") if manny.is_holding ~= ly.sheet then ly:manny_take_sheet_from_meche() end meche:wait_for_message() manny:say_line("/lyma044/") else manny:say_line("/lyma045/") manny:wait_for_message() meche:say_line("/lymc046/") if manny.is_holding ~= ly.sheet then ly:manny_take_sheet_from_meche() end end end END_CUT_SCENE() end ly.manny_take_sheet_from_meche = function(arg1) -- line 1071 manny:walkto_object(ly.meche_obj) manny:wait_for_actor() if meche:is_choring(meche_seduction_mec_sed_ch, FALSE, "meche_seduction.cos") then meche:wait_for_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") end stop_script(ly.seduce_charlie) stop_script(ly.meche_idles) meche:stop_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:play_chore(0, "mi_msb_sheet.cos") manny:push_costume("msb_msb_sheet.cos") manny:setrot(0, 231.446, 0) manny:play_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") ly.sheet:get() manny.is_holding = ly.sheet meche:wait_for_chore(0, "mi_msb_sheet.cos") meche:stop_chore(0, "mi_msb_sheet.cos") meche:play_chore(meche_ruba_hands_down_hold, "meche_ruba.cos") manny:wait_for_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") manny:stop_chore(msb_msb_sheet_pass_sheet, "msb_msb_sheet.cos") manny:run_chore(msb_msb_sheet_to_hold_pos, "msb_msb_sheet.cos") manny:stop_chore(msb_msb_sheet_to_hold_pos, "msb_msb_sheet.cos") manny:run_chore(msb_msb_sheet_hold_sheet, "msb_msb_sheet.cos") meche.holding_sheet = FALSE inventory_disabled = TRUE ly.ready_to_seduce = FALSE single_start_script(ly.meche_idles) end ly.talk_toga_with_charlie = function(arg1) -- line 1101 START_CUT_SCENE() stop_script(ly.charlie_idles) manny:walkto_object(ly.charlie_obj) if ly.meche_talk_count < 3 then manny:say_line("/lyma047/") charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") if find_script(ly.seduce_charlie) then while ly.ready_to_seduce do break_here() end end manny:wait_for_message() charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:push_costume("cc_taplook.cos") charlie:run_chore(cc_taplook_turn2mn, "cc_taplook.cos") charlie:say_line("/lycc048/") charlie:run_chore(cc_taplook_turn2slots, "cc_taplook.cos") else manny:say_line("/lyma049/") charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") if find_script(ly.seduce_charlie) then while ly.ready_to_seduce do break_here() end end manny:wait_for_message() charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:push_costume("cc_taplook.cos") charlie:run_chore(cc_taplook_turn2mn, "cc_taplook.cos") charlie:say_line("/lycc050/") charlie:wait_for_message() charlie:play_chore(cc_taplook_turn2slots, "cc_taplook.cos") charlie:say_line("/lycc051/") charlie:wait_for_chore(cc_taplook_turn2slots, "cc_taplook.cos") end if not find_script(charlies_slot.stop) then charlies_slot:stop() else wait_for_script(charlies_slot.stop) end charlie:stop_chore(cc_taplook_turn2slots, "cc_taplook.cos") charlie:pop_costume() start_script(ly.charlie_idles, ly) END_CUT_SCENE() end ly.throw_sheet = function(arg1) -- line 1149 START_CUT_SCENE() stop_script(ly.charlie_idles) charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") stop_script(charlies_slot.stop) stop_sound("ly_wheel.IMU") stop_script(slot_wheel.spin) if not ly.sheet_on_floor.has_object_states then ly:add_object_state(ly_sltha, "ly_cc_sheet.bm", "ly_cc_sheet.zbm", OBJSTATE_STATE, TRUE) ly.sheet_on_floor:set_object_state("ly_cc_sheet.cos") ly.sheet_on_floor.interest_actor:put_in_set(ly) end ly.sheet:free() ly.charlie_on_floor = TRUE ly.charlie_obj:make_untouchable() box_off("charlie_box") box_off("mannys_slot") manny.is_holding = nil manny:stop_chore(msb_msb_sheet_hold_sheet, "msb_msb_sheet.cos") inventory_disabled = FALSE manny:pop_costume() manny:setpos(1.50568, -0.210109, 0) manny:setrot(0, 176.891, 0) charlie:stop_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlie:set_visibility(FALSE) ly.sheet_on_floor:play_chore(ly_cc_sheet_here) stop_sound("um_roll.IMU") StartFullscreenMovie("ly_sheet_toss.snm") sleep_for(500) start_sfx("cc_shtts.WAV") ly.slot_handle[4]:set_visibility(TRUE) sleep_for(1000) if not ly.sheeted then ly.sheeted = TRUE charlie:say_line("/lycc052/") else charlie:say_line("/lycc053/") end sleep_for(4600) start_sfx("ccsheet1.wav") sleep_for(1250) start_sfx("cc_falls.wav") charlie:wait_for_message() charlie:say_line("/lycc054/") charlie:wait_for_message() ly.sheet_on_floor:play_chore(ly_cc_sheet_protest) wait_for_movie() if not unicycle_man.in_machine then if not unicycle_man.rolling then elseif not sound_playing("um_roll.IMU") then unicycle_man:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end end start_script(ly.charlie_struggle) start_script(ly.charlie_get_up_timer) END_CUT_SCENE() end ly.charlie_struggle = function(arg1) -- line 1226 local local1 local local2 = { "/lycc055/", "/lycc056/", "/lycc057/", "/lycc058/", "/lycc059/", "/lycc060/", "/lycc061/", "/lycc062/", "/lycc063/" } while TRUE do sleep_for(2000) ly.sheet_on_floor:play_chore(ly_cc_sheet_protest) local1 = pick_one_of({ "ccsheet1.wav", "ccsheet2.wav", "ccsheet3.wav", "ccsheet4.wav", "ccsheet5.wav", "ccsheet6.wav" }) start_sfx(local1, IM_HIGH_PRIORITY, 100) charlie:say_line(pick_one_of(local2, TRUE), { background = TRUE, skip_log = TRUE, volume = 80 }) charlie:wait_for_message() end end ly.charlie_get_up_timer = function(arg1) -- line 1248 sleep_for(25000) stop_script(ly.charlie_struggle) while cutSceneLevel > 0 do break_here() end START_CUT_SCENE() ly.charlie_on_floor = FALSE ly.charlie_obj:make_touchable() box_on("charlie_box") box_on("mannys_slot") stop_sound("um_roll.IMU") StartFullscreenMovie("ly_getup.snm") charlie:set_visibility(TRUE) ly.slot_handle[4]:set_visibility(FALSE) stop_script(ly.meche_idles) charlie:push_costume("cc_seduction.cos") charlie:play_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") meche:stop_chore(nil, "meche_ruba.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche.holding_sheet = TRUE sleep_for(2000) start_sfx("ccsheet1.wav") sleep_for(2500) start_sfx("cc_shtof.WAV") charlie:say_line("/lycc064/", { volume = 90 }) wait_for_movie() ly.sheet_on_floor.interest_actor:put_in_set(ly) ly.sheet_on_floor.interest_actor:stop_chore() ly.sheet_on_floor:complete_chore(ly_cc_sheet_gone) ForceRefresh() if not unicycle_man.in_machine then if not unicycle_man.rolling then elseif not sound_playing("um_roll.IMU") then unicycle_man:play_sound_at("um_roll.IMU", ly.unicycle_roll_min_vol, ly.unicycle_roll_max_vol) end end charlie:wait_for_message() charlie:say_line("/lycc065/") charlie:wait_for_message() charlie:wait_for_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") charlie:pop_costume() END_CUT_SCENE() start_script(ly.charlie_idles, ly) start_script(ly.meche_idles, ly) end ly.charlies_jackpot = function(arg1) -- line 1310 local local1 local local2 local local3, local4 stop_script(ly.charlie_get_up_timer) stop_script(ly.charlie_idles) stop_script(ly.meche_idles) START_CUT_SCENE() start_script(ly.unicycle_stop_idles, ly) if not find_script(charlies_slot.stop) then start_script(charlies_slot.stop, charlies_slot, FALSE) end ly:add_object_state(ly_chaws, "ly_slot_door.bm", "ly_slot_door.zbm", OBJSTATE_STATE) ly.charlie_obj:set_object_state("ly_slot_door.cos") ly.charlie_obj.interest_actor:set_visibility(TRUE) ly.charlie_obj.interest_actor:put_in_set(ly) manny:walkto(0.60399699, -0.122419, 0, 0, 324.94, 0) manny:say_line("/lyma082/") manny:wait_for_message() wait_for_script(ly.unicycle_stop_idles) unicycle_man:turn_to_manny() local1 = GetActorYawToPoint(manny.hActor, unicycle_man.point["charlie"].pos) manny:setrot(0, local1, 0, TRUE) manny:point_gesture() manny:say_line("/lyma083/") manny:wait_for_message() start_script(unicycle_man.cycle_straight_to, unicycle_man, unicycle_man.point["charlie"].pos, unicycle_man.point["charlie"].rot) unicycle_man:say_line("/lyum084/") unicycle_man:wait_for_message() wait_for_script(unicycle_man.cycle_straight_to) unicycle_man:wait_for_actor() unicycle_man:setpos(1.90781, -0.36290601, 0) unicycle_man:setrot(0, 270, 0) ly:current_setup(ly_chaws) meche:set_visibility(FALSE) unicycle_man:set_chore_looping(unicycle_man_idles, FALSE) unicycle_man:wait_for_chore(unicycle_man_idles) unicycle_man:play_chore(unicycle_man_crawl_slot) stop_sound("um_roll.IMU") sleep_for(3500) ly.charlie_obj:run_chore(ly_slot_door_open) sleep_for(3300) unicycle_man:play_chore(unicycle_man_hide_body) unicycle_man:wait_for_chore(unicycle_man_crawl_slot) start_script(ly.unicycle_slot_sfx) ly.charlie_obj:run_chore(ly_slot_door_close) sleep_for(1000) charlies_slot:scramble_to_win() local3 = Actor:create(nil, nil, nil, "Money") local3:set_costume("coin_pile.cos") local3:put_in_set(ly) local3:setpos(1.99385, -0.48749301, 0.16) local3:setrot(0, 0, 0) local4 = 0.1 start_sfx("ly_pyoff.IMU") while local4 <= 1 do SetActorScale(local3.hActor, local4) break_here() local4 = local4 + 0.050000001 end fade_sfx("ly_pyoff.IMU", 1000) sleep_for(2500) ly.charlie_obj:run_chore(ly_slot_door_open) unicycle_man:play_chore(unicycle_man_out_slot_no_grab) sleep_for(500) unicycle_man:play_chore(unicycle_man_show_body) sleep_for(4000) ly.charlie_obj:play_chore(ly_slot_door_close) unicycle_man:wait_for_chore(unicycle_man_out_slot_no_grab) ly:current_setup(ly_sltha) meche:set_visibility(TRUE) start_script(unicycle_man.cycle_straight_to, unicycle_man, unicycle_man.point[0].pos, unicycle_man.point[0].rot) sleep_for(3000) stop_script(ly.charlie_struggle) ly.sheet_on_floor.interest_actor:put_in_set(ly) ly.sheet_on_floor.interest_actor:stop_chore() stop_script(unicycle_man.cycle_straight_to) stop_sound("um_roll.IMU") StartFullscreenMovie("ly_win.snm") sleep_for(3000) start_sfx("cc_shtof.WAV") wait_for_movie() ly:current_setup(ly_sltha) unicycle_man:setpos(unicycle_man.point[0].pos.x, unicycle_man.point[0].pos.y, unicycle_man.point[0].pos.z) unicycle_man:setrot(unicycle_man.point[0].rot.x, unicycle_man.point[0].rot.y, unicycle_man.point[0].rot.z) unicycle_man:stop_chore(unicycle_man_roll) unicycle_man:play_chore_looping(unicycle_man_idles) charlie:stop_chore(nil, "cc_play_slot.cos") charlie:play_chore(cc_play_slot_hide_handle, "cc_play_slot.cos") charlie:push_costume("cc_seduction.cos") charlie:setpos(1.49489, -0.50857699, -0.119) charlie:setrot(0, 260, 0) charlie:set_visibility(TRUE) meche:setpos(1.44189, -0.845577, 0) meche:setrot(0, 330, 0) meche:stop_chore(nil, "meche_ruba.cos") meche:stop_chore(nil, "meche_seduction.cos") meche:stop_chore(nil, "mi_msb_sheet.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche:set_visibility(TRUE) charlie:play_chore(cc_seduction_take_money, "cc_seduction.cos") ly.sheet_on_floor.interest_actor:stop_chore() ly.sheet_on_floor:complete_chore(ly_cc_sheet_gone) ForceRefresh() charlie:say_line("/lycc085/") sleep_for(3200) while local4 >= 0.1 and charlie:is_speaking() do local4 = local4 - 0.1 SetActorScale(local3.hActor, local4) break_here() end charlie:wait_for_message() meche:say_line("/lymc086/") while local4 >= 0.1 and charlie:is_speaking() do local4 = local4 - 0.1 SetActorScale(local3.hActor, local4) break_here() end local3:free() local3 = nil charlie:wait_for_chore(cc_seduction_take_money, "cc_seduction.cos") box_on("charlie_box") box_on("mannys_slot") box_on("meche_box") music_state:set_sequence(seqChowchillaBye) IrisDown(450, 320, 1000) sleep_for(1500) ly:current_setup(ly_lavha) unicycle_man:free() stop_sound("um_roll.IMU") manny:setpos(2.22596, 3.59653, 0.89999998) manny:setrot(0, 102.462, 0) manny:set_collision_mode(COLLISION_OFF) meche:set_costume(nil) meche:set_costume("meche_ruba.cos") meche:set_mumble_chore(meche_ruba_mumble) meche:set_talk_chore(1, meche_ruba_stop_talk) meche:set_talk_chore(2, meche_ruba_a) meche:set_talk_chore(3, meche_ruba_c) meche:set_talk_chore(4, meche_ruba_e) meche:set_talk_chore(5, meche_ruba_f) meche:set_talk_chore(6, meche_ruba_l) meche:set_talk_chore(7, meche_ruba_m) meche:set_talk_chore(8, meche_ruba_o) meche:set_talk_chore(9, meche_ruba_t) meche:set_talk_chore(10, meche_ruba_u) meche:push_costume("mi_with_cc_toga.cos") meche:set_collision_mode(COLLISION_OFF) meche:setpos(2.03021, 3.5079, 0.90061998) meche:setrot(0, 306.86899, 0) meche:play_chore(meche_ruba_xarm_hold, "meche_ruba.cos") charlie:set_costume(nil) charlie:set_costume("cc_toga.cos") charlie:set_mumble_chore(cc_toga_mumble) charlie:set_talk_chore(1, cc_toga_stop_talk) charlie:set_talk_chore(2, cc_toga_a) charlie:set_talk_chore(3, cc_toga_c) charlie:set_talk_chore(4, cc_toga_e) charlie:set_talk_chore(5, cc_toga_f) charlie:set_talk_chore(6, cc_toga_l) charlie:set_talk_chore(7, cc_toga_m) charlie:set_talk_chore(8, cc_toga_o) charlie:set_talk_chore(9, cc_toga_t) charlie:set_talk_chore(10, cc_toga_u) charlie:set_collision_mode(COLLISION_OFF) charlie:set_walk_chore(cc_toga_walk) charlie:set_walk_rate(0.25) charlie:set_head(7, 8, 9, 120, 80, 80) charlie:set_look_rate(100) ly.mens_room:open() charlie:setpos(1.89022, 4.5444798, 0.89999998) charlie:setrot(0, 180.181, 0) charlie:follow_boxes() charlie.footsteps = footsteps.marble if not ly.mens_room.has_object_states then ly:add_object_state(ly_lavha, "ly_bath.bm", "ly_bath.zbm", OBJSTATE_STATE) ly.mens_room:set_object_state("ly_bath_door.cos") end IrisUp(125, 325, 1000) sleep_for(500) manny:head_look_at(nil) meche:head_look_at(nil) manny:head_forward_gesture() manny:say_line("/lyma087/") manny:wait_for_message() manny:twist_head_gesture() manny:say_line("/lyma088/") manny:wait_for_message() meche:play_chore(meche_ruba_drop_hands, "meche_ruba.cos") meche:say_line("/lymc089/") meche:wait_for_message() meche:wait_for_chore(meche_ruba_drop_hands, "meche_ruba.cos") ly.mens_room:play_chore(0) start_sfx("ly_batho.WAV") manny:head_look_at_point(1.94195, 3.9626, 1.302) charlie:walkto(1.95579, 3.78863, 0.89999998) sleep_for(500) start_script(manny.backup, manny, 1000) while charlie:is_moving() do if not charlie:find_sector_name("bath_psg") then charlie.footsteps = footsteps.rug end break_here() end charlie.footsteps = footsteps.rug ly.mens_room:play_chore(1) start_sfx("ly_bathc.WAV") ly.mens_room:close() charlie:say_line("/lycc090/", { x = 160, y = 30 }) meche:stop_chore(meche_ruba_xarm_hold, "meche_ruba.cos") meche:stop_chore(meche_ruba_drop_hands, "meche_ruba.cos") mi_with_cc_done_turning = FALSE meche:play_chore(mi_with_cc_toga_to_cc_toga, "mi_with_cc_toga.cos") sleep_for(1000) charlie:head_look_at(meche) sleep_for(2400) charlie:head_look_at(nil) charlie:setrot(0, 100, 0, TRUE) charlie:fade_in_chore(cc_toga_take_meche, "cc_toga.cos", 500) charlie:wait_for_chore(cc_toga_take_meche, "cc_toga.cos") charlie:play_chore(cc_toga_hold_meche, "cc_toga.cos") while mi_with_cc_done_turning < 1 do break_here() end while meche:is_choring(mi_with_cc_toga_to_cc_toga, FALSE, "mi_with_cc_toga.cos") do WalkActorForward(charlie.hActor) break_here() end meche:wait_for_chore(mi_with_cc_toga_to_cc_toga, "mi_with_cc_toga.cos") manny:head_look_at(nil) END_CUT_SCENE() ly.charlie_on_floor = FALSE ly.sheet_on_floor:make_untouchable() ly.charlie_obj:make_untouchable() ly.meche_obj:make_untouchable() ly.unicycle_man:make_untouchable() ly.charlie_gone = TRUE music_state:update() cur_puzzle_state[56] = TRUE charlie:free() meche:free() end ly.charlie_idles = function(arg1) -- line 1596 while system.currentSet == ly do ly.ready_to_seduce = FALSE charlie:play_chore(cc_play_slot_play_slots, "cc_play_slot.cos") sleep_for(1000) charlies_slot:spin() charlie:wait_for_chore(cc_play_slot_play_slots, "cc_play_slot.cos") charlies_slot:stop(FALSE) if find_script(ly.seduce_charlie) then ly.ready_to_seduce = TRUE while ly.ready_to_seduce do break_here() end end break_here() end end ly.meche_idles = function(arg1) -- line 1614 local local1 = FALSE while system.currentSet == ly do if meche.holding_sheet then if rnd(8) and not find_script(ly.seduce_charlie) then if cutSceneLevel <= 0 then start_script(ly.seduce_charlie, ly) wait_for_script(ly.seduce_charlie) end end elseif rnd(5) then if local1 then meche:run_chore(meche_ruba_drop_hands, "meche_ruba.cos") local1 = FALSE sleep_for(rndint(1000, 5000)) else meche:run_chore(meche_ruba_xarms, "meche_ruba.cos") local1 = TRUE sleep_for(rndint(5000, 10000)) end end break_here() end end ly.seduce_charlie = function(arg1) -- line 1642 while not ly.ready_to_seduce do break_here() end ly.meche_obj:make_untouchable() charlie:set_collision_mode(COLLISION_SPHERE, 0.8) meche:play_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") sleep_for(1000) charlie:push_costume("cc_seduction.cos") charlie:fade_in_chore(cc_seduction_sed_by_mec, "cc_seduction.cos", 500) sleep_for(6000) ly.meche_obj:make_touchable() charlie:set_collision_mode(COLLISION_OFF) charlie:wait_for_chore(cc_seduction_sed_by_mec, "cc_seduction.cos") charlie:pop_costume() ly.ready_to_seduce = FALSE meche:wait_for_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:stop_chore(meche_seduction_mec_sed_ch, "meche_seduction.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") end ly.set_up_actors = function(arg1) -- line 1665 ly.keno_actor:default() ly.slot_handle:init() charlies_slot:default() mannys_slot:default() mannys_slot:freeze() brennis:put_in_set(ly) brennis:default() brennis:push_costume("br_idles.cos") brennis:setpos(-0.0427321, 4.02445, 0.9) brennis:setrot(0, -2343.65, 0) ly:brennis_start_idle() if not ly.charlie_gone then charlie:set_costume(nil) charlie:set_costume("ccharlie.cos") charlie:set_mumble_chore(ccharlie_mumble) charlie:set_talk_chore(1, ccharlie_no_talk) charlie:set_talk_chore(2, ccharlie_a) charlie:set_talk_chore(3, ccharlie_c) charlie:set_talk_chore(4, ccharlie_e) charlie:set_talk_chore(5, ccharlie_f) charlie:set_talk_chore(6, ccharlie_l) charlie:set_talk_chore(7, ccharlie_m) charlie:set_talk_chore(8, ccharlie_o) charlie:set_talk_chore(9, ccharlie_t) charlie:set_talk_chore(10, ccharlie_u) charlie:push_costume("cc_play_slot.cos") charlie:put_in_set(ly) charlie:ignore_boxes() charlie:setpos(1.83869, -0.508564, 0.014) charlie:setrot(0, 260, 0) start_script(ly.charlie_idles, ly) meche:set_costume(nil) meche:set_costume("meche_ruba.cos") meche:set_mumble_chore(meche_ruba_mumble) meche:set_talk_chore(1, meche_ruba_stop_talk) meche:set_talk_chore(2, meche_ruba_a) meche:set_talk_chore(3, meche_ruba_c) meche:set_talk_chore(4, meche_ruba_e) meche:set_talk_chore(5, meche_ruba_f) meche:set_talk_chore(6, meche_ruba_l) meche:set_talk_chore(7, meche_ruba_m) meche:set_talk_chore(8, meche_ruba_o) meche:set_talk_chore(9, meche_ruba_t) meche:set_talk_chore(10, meche_ruba_u) meche:put_in_set(ly) meche:ignore_boxes() meche:setpos(1.4388, -0.679984, 0) meche:setrot(0, 313.314, 0) meche:push_costume("meche_seduction.cos") meche:push_costume("mi_msb_sheet.cos") meche:play_chore(meche_seduction_rest_pos, "meche_seduction.cos") meche.holding_sheet = TRUE start_script(ly.meche_idles, ly) unicycle_man:default() unicycle_man:put_in_set(ly) unicycle_man:restore_pos() start_script(ly.unicycle_idles, ly) else charlie:free() meche:free() unicycle_man:free() end end ly.set_up_object_states = function(arg1) -- line 1737 ly:add_object_state(ly_kenla, "ly_keno_1.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_2.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_3.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_4.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_5.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_6.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_7.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_8.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_9.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_10.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_11.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_12.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_13.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_14.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_15.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_16.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_17.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_18.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_19.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_20.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_21.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_22.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_23.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_24.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_25.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_26.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_27.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_28.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_29.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_30.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_31.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_kenla, "ly_keno_32.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_4.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_5.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_6.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_7.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_8.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_9.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_10.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_11.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_12.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_13.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_14.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_15.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_16.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_17.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_18.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_19.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_20.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_21.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_22.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_23.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_24.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_25.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_26.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_27.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_28.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_29.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_30.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_31.bm", nil, OBJSTATE_UNDERLAY) ly:add_object_state(ly_intha, "ly_keno_t_32.bm", nil, OBJSTATE_UNDERLAY) end ly.cameraman = function(arg1) -- line 1804 local local1, local2 local local3 cameraman_watching_set = arg1 if cameraman_disabled == FALSE and arg1:current_setup() ~= arg1.setups.overhead and cutSceneLevel <= 0 then local1, cameraman_box_name, local2 = system.currentActor:find_sector_type(CAMERA) if cameraman_box_name then local3 = getglobal(cameraman_box_name) if local3 ~= nil and ly:current_setup() ~= local3 then ly:current_setup(local3) end elseif ly:current_setup() ~= "ly_intha" then ly:current_setup(ly_intha) end end end ly.manny_collisions = function(arg1) -- line 1826 while system.currentSet == ly do if manny:find_sector_name("slot_box") or manny:find_sector_name("mannys_slot") or manny:find_sector_name("charlie_box") or manny:find_sector_name("meche_box") then manny:set_collision_mode(COLLISION_SPHERE, 0.35) else manny:set_collision_mode(COLLISION_OFF) end break_here() end end ly.update_music_state = function(arg1) -- line 1843 if ly.charlie_gone then return stateLY_BREN else return stateLY end end ly.enter = function(arg1) -- line 1852 ly:set_up_object_states() ly:set_up_actors() start_script(ly.gun_control) start_script(ly.keno_actor.game, ly.keno_actor) start_script(ly.manny_collisions, ly) ly:add_ambient_sfx({ "lyAmb1.wav", "lyAmb2.wav", "lyAmb3.wav", "lyAmb4.wav" }, { min_volume = 40, max_volume = 127, min_delay = 6000, max_delay = 10000 }) SetShadowColor(10, 10, 10) SetActiveShadow(manny.hActor, 0) SetActorShadowPoint(manny.hActor, 0, -4, 4) SetActorShadowPlane(manny.hActor, "shadow1") AddShadowPlane(manny.hActor, "shadow1") end ly.exit = function(arg1) -- line 1872 stop_script(ly.manny_collisions) manny:set_collision_mode(COLLISION_OFF) stop_script(slot_wheel.spin) stop_script(ly.unicycle_idles) stop_script(ly.unicycle_slot_sfx) stop_script(ly.keno_actor.game) ly.keno_actor:free() charlies_slot:free() mannys_slot:free() stop_script(ly.charlie_idles) charlie:free() meche:free() if brennis.ly_idle_script then stop_script(brennis.ly_idle_script) brennis.ly_idle_script = nil end brennis:free() unicycle_man:save_pos() unicycle_man:free() stop_script(ly.gun_control) stop_script(ly.charlie_struggle) stop_script(ly.charlie_get_up_timer) ly.sheet_on_floor.interest_actor:set_costume(nil) ly.sheet_on_floor.has_object_states = FALSE ly.mens_room.interest_actor:set_costume(nil) ly.mens_room.has_object_states = FALSE ly.service_door.interest_actor:set_costume(nil) ly.service_door.has_object_states = FALSE stop_sound("um_roll.IMU") stop_sound("ly_pyoff.IMU") stop_sound("ly_wheel.IMU") KillActorShadows(manny.hActor) end ly.sheet = Object:create(ly, "/lytx091/sheet", 0, 0, 0, { range = 0 }) ly.sheet.use = function(arg1) -- line 1928 manny:say_line("/lyma092/") end ly.sheet.lookAt = function(arg1) -- line 1932 manny:say_line("/lyma093/") end ly.sheet.default_response = ly.sheet.use ly.brennis_obj = Object:create(ly, "/lytx094/elevator demon", -0.048044398, 3.9284, 1.51, { range = 0.80000001 }) ly.brennis_obj.use_pnt_x = -0.12957799 ly.brennis_obj.use_pnt_y = 3.47597 ly.brennis_obj.use_pnt_z = 0.89999998 ly.brennis_obj.use_rot_x = 0 ly.brennis_obj.use_rot_y = 349.754 ly.brennis_obj.use_rot_z = 0 ly.brennis_obj.person = TRUE ly.brennis_obj.demon = TRUE ly.brennis_obj.lookAt = function(arg1) -- line 1951 manny:say_line("/lyma095/") end ly.brennis_obj.pickUp = function(arg1) -- line 1955 system.default_response("right") end ly.brennis_obj.use = function(arg1) -- line 1959 if not manny.fancy then if manny:walkto_object(arg1) then start_script(ly.talk_clothes_with_brennis) end elseif fi.gun.owner ~= manny then manny:turn_left(180) manny:say_line("/lyma096/") else Dialog:run("br2", "dlg_brennis2.lua") end end ly.brennis_obj.use_sheet = function(arg1) -- line 1974 START_CUT_SCENE() manny:say_line("/lyma097/") wait_for_message() brennis:say_line("/lybs098/") END_CUT_SCENE() end ly.statue = Object:create(ly, "/lytx099/statue", 3.34677, -2.6134701, 2.5899999, { range = 1.6 }) ly.statue.use_pnt_x = 3.34677 ly.statue.use_pnt_y = -1.78347 ly.statue.use_pnt_z = 0.44999999 ly.statue.use_rot_x = 0 ly.statue.use_rot_y = 922.95398 ly.statue.use_rot_z = 0 ly.statue.lookAt = function(arg1) -- line 1992 manny:say_line("/lyma100/") end ly.statue.pickUp = function(arg1) -- line 1996 system.default_response("right") end ly.statue.use = function(arg1) -- line 2000 manny:say_line("/lyma101/") end ly.statue.use_sheet = function(arg1) -- line 2004 manny:say_line("/lyma102/") end ly.charlie_obj = Object:create(ly, "/lytx103/Chowchilla Charlie", 1.82118, -0.51648003, 0.37200001, { range = 0.60000002 }) ly.charlie_obj.use_pnt_x = 1.61446 ly.charlie_obj.use_pnt_y = -0.26686499 ly.charlie_obj.use_pnt_z = 0 ly.charlie_obj.use_rot_x = 0 ly.charlie_obj.use_rot_y = 220.021 ly.charlie_obj.use_rot_z = 0 ly.charlie_obj.person = TRUE ly.charlie_obj.lookAt = function(arg1) -- line 2019 if not arg1.seen then START_CUT_SCENE() arg1.seen = TRUE manny:say_line("/lyma104/") manny:wait_for_message() manny:say_line("/lyma105/") END_CUT_SCENE() else manny:say_line("/lyma106/") end end ly.charlie_obj.pickUp = function(arg1) -- line 2032 manny:say_line("/lyma107/") end ly.charlie_obj.use = function(arg1) -- line 2036 start_script(ly.talk_toga_with_charlie) end ly.charlie_obj.use_sheet = function(arg1) -- line 2040 start_script(ly.throw_sheet) end ly.meche_obj = Object:create(ly, "/lytx108/Meche", 1.52403, -0.63770503, 0.47499999, { range = 0.80000001 }) ly.meche_obj.use_pnt_x = 1.65277 ly.meche_obj.use_pnt_y = -0.32719201 ly.meche_obj.use_pnt_z = 0 ly.meche_obj.use_rot_x = 0 ly.meche_obj.use_rot_y = 153.737 ly.meche_obj.use_rot_z = 0 ly.meche_obj.person = TRUE ly.meche_obj.lookAt = function(arg1) -- line 2055 manny:say_line("/lyma109/") end ly.meche_obj.pickUp = function(arg1) -- line 2059 system.default_response("not now") end ly.meche_obj.use = function(arg1) -- line 2063 start_script(ly.talk_clothes_with_meche) end ly.meche_obj.use_sheet = function(arg1) -- line 2067 if ly.meche_talk_count < 4 then arg1:use() else manny:say_line("/lyma110/") manny:wait_for_message() meche:say_line("/lymc111/") end end ly.slot1 = Object:create(ly, "/lytx112/slot machine", 1.98998, -0.113677, 0.47, { range = 0.60000002 }) ly.slot1.use_pnt_x = 1.63983 ly.slot1.use_pnt_y = -0.272295 ly.slot1.use_pnt_z = 0 ly.slot1.use_rot_x = 0 ly.slot1.use_rot_y = 280.24301 ly.slot1.use_rot_z = 0 ly.slot1.lookAt = function(arg1) -- line 2087 manny:say_line("/lyma113/") end ly.slot1.pickUp = function(arg1) -- line 2091 system.default_response("portable") end ly.slot1.use = function(arg1) -- line 2095 if manny:find_sector_name("mannys_slot") then start_script(ly.playslots, ly, arg1) elseif manny:walkto_object(arg1) then start_script(ly.playslots, ly, arg1) end end ly.slot1.use_sheet = function(arg1) -- line 2103 manny:say_line("/lyma114/") end ly.sheet_on_floor = Object:create(ly, "/lytx115/sheet", 1.7376, -0.488377, 0, { range = 0.60000002 }) ly.sheet_on_floor.use_pnt_x = 1.5376 ly.sheet_on_floor.use_pnt_y = -0.62837702 ly.sheet_on_floor.use_pnt_z = 0 ly.sheet_on_floor.use_rot_x = 0 ly.sheet_on_floor.use_rot_y = -33.944099 ly.sheet_on_floor.use_rot_z = 0 ly.sheet_on_floor:make_untouchable() ly.sheet_on_floor.lookAt = function(arg1) -- line 2118 manny:say_line("/lyma116/") end ly.sheet_on_floor.pickUp = function(arg1) -- line 2122 arg1:make_untouchable() ly.sheet:hold() end ly.sheet_on_floor.use = ly.sheet_on_floor.pickUp ly.unicycle_man = Object:create(ly, "/lytx117/gambler", 1.05716, 0.50252402, 0.40000001, { range = 0.80000001 }) ly.unicycle_man.use_pnt_x = 1.2671601 ly.unicycle_man.use_pnt_y = 0.25252399 ly.unicycle_man.use_pnt_z = 0 ly.unicycle_man.use_rot_x = 0 ly.unicycle_man.use_rot_y = 1495.33 ly.unicycle_man.use_rot_z = 0 ly.unicycle_man.person = TRUE ly.unicycle_man.lookAt = function(arg1) -- line 2140 if not ly.met_agent then manny:say_line("/lyma118/") else manny:say_line("/lyma119/") end end ly.unicycle_man.pickUp = function(arg1) -- line 2148 system.default_response("think") end ly.unicycle_man.use = function(arg1) -- line 2152 start_script(ly.talk_to_agent) end ly.mens_room = Object:create(ly, "/lytx120/door", 2.03262, 4.2983999, 1.39, { range = 0.5 }) ly.mens_room.use_pnt_x = 1.9454401 ly.mens_room.use_pnt_y = 3.98 ly.mens_room.use_pnt_z = 0.89999998 ly.mens_room.use_rot_x = 0 ly.mens_room.use_rot_y = 14.326 ly.mens_room.use_rot_z = 0 ly.mens_room.out_pnt_x = 1.76959 ly.mens_room.out_pnt_y = 4.6870298 ly.mens_room.out_pnt_z = 0.89999998 ly.mens_room.out_rot_x = 0 ly.mens_room.out_rot_y = 4.1866498 ly.mens_room.out_rot_z = 0 ly.mens_room.passage = { "bath_psg" } ly.mens_room.lookAt = function(arg1) -- line 2175 manny:say_line("/lyma121/") end ly.mens_room.walkOut = function(arg1) -- line 2179 START_CUT_SCENE() if manny.is_holding == ly.sheet then system.default_response("no") manny:walkto(1.96305, 3.77355, 0.9, 0, 184.876, 0) manny:wait_for_message() ly.sheet:use() elseif not manny.fancy then if not ly.mens_room.has_object_states then ly:add_object_state(ly_lavha, "ly_bath.bm", "ly_bath.zbm", OBJSTATE_STATE) ly.mens_room:set_object_state("ly_bath_door.cos") end if not ly.charlie_gone then if not ly.peed then ly.peed = TRUE arg1:open_door_and_enter() manny:say_line("/lyma122/") manny:wait_for_message() manny:say_line("/lyma123/") else manny:say_line("/lyma124/") end else manny.fancy = TRUE arg1:open_door_and_enter() manny:shrug_gesture() manny:say_line("/lyma125/") end else manny:say_line("/lyma126/") end END_CUT_SCENE() end ly.mens_room.open_door_and_enter = function(arg1) -- line 2216 manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z, arg1.use_rot_x, arg1.use_rot_y, arg1.use_rot_z) manny:play_chore(msb_hand_on_obj, manny.base_costume) sleep_for(200) arg1:play_chore(0) start_sfx("ly_batho.WAV") arg1:open() manny:wait_for_chore(msb_hand_on_obj, manny.base_costume) manny:stop_chore(msb_hand_on_obj, manny.base_costume) manny:play_chore(msb_hand_off_obj, manny.base_costume) manny:walkto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) manny:wait_for_actor() arg1:play_chore(1) start_sfx("ly_bathc.WAV") manny:wait_for_chore(msb_hand_off_obj, manny.base_costume) manny:stop_chore(msb_hand_off_obj, manny.base_costume) if manny.fancy then sleep_for(3000) manny:default("thunder") else sleep_for(4000) start_sfx("ly_urinl.WAV") end arg1:play_chore(0) start_sfx("ly_batho.WAV") arg1:wait_for_chore(0) manny:setrot(arg1.out_rot_x, arg1.out_rot_y + 180, arg1.out_rot_z) manny:walkto(1.96305, 3.77355, 0.9, 0, 184.876, 0) manny:wait_for_actor() arg1:play_chore(1) start_sfx("ly_bathc.WAV") arg1:close() end ly.service_door = Object:create(ly, "/lytx120/door", 2.5296299, 4.0496202, 1.339, { range = 0.5 }) ly.service_door.use_pnt_x = 2.5390899 ly.service_door.use_pnt_y = 3.6882501 ly.service_door.use_pnt_z = 0.89999998 ly.service_door.use_rot_x = 0 ly.service_door.use_rot_y = 358.625 ly.service_door.use_rot_z = 0 ly.service_door.out_pnt_x = 2.53511 ly.service_door.out_pnt_y = 4.48 ly.service_door.out_pnt_z = 0.89999998 ly.service_door.out_rot_x = 0 ly.service_door.out_rot_y = 359.58701 ly.service_door.out_rot_z = 0 ly.service_door.touchable = FALSE ly.service_door.passage = { "service_psg" } ly.service_door.walkOut = function(arg1) -- line 2271 START_CUT_SCENE() if manny.is_holding == ly.sheet then system.default_response("no") manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z, arg1.use_rot_x, arg1.use_rot_y + 180, arg1.use_rot_z) manny:wait_for_message() ly.sheet:use() else if not ly.service_door.has_object_states then ly:add_object_state(ly_lavha, "ly_service.bm", "ly_service.zbm", OBJSTATE_STATE) ly.service_door:set_object_state("ly_service_door.cos") end manny:walkto(2.56884, 3.85944, 0.9, 0, 16.9137, 0) manny:wait_for_actor() manny:play_chore(msb_reach_med, manny.base_costume) sleep_for(250) start_script(manny.backup, manny, 350) sleep_for(250) arg1:play_chore(0) arg1:wait_for_chore(0) arg1:open() manny:walkto(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) sleep_for(1000) arg1:play_chore(1) arg1:close() end END_CUT_SCENE() if manny.is_holding ~= ly.sheet then te:come_out_door(te.ly_door) end end ly.service_door.comeOut = function(arg1) -- line 2304 START_CUT_SCENE() ly:switch_to_set() ly:current_setup(ly_lavha) if not ly.service_door.has_object_states then ly:add_object_state(ly_lavha, "ly_service.bm", "ly_service.zbm", OBJSTATE_STATE) ly.service_door:set_object_state("ly_service_door.cos") end arg1:open() manny:put_in_set(ly) manny:setpos(arg1.out_pnt_x, arg1.out_pnt_y, arg1.out_pnt_z) manny:setrot(arg1.out_rot_x, arg1.out_rot_y + 180, arg1.out_rot_z) if not manny.fancy then manny:play_chore(msb_hand_off_obj, manny.base_costume) else manny:play_chore(mcc_thunder_hand_off_obj, "mcc_thunder.cos") end arg1:play_chore(0) arg1:wait_for_chore(0) if not manny.fancy then manny:wait_for_chore(msb_hand_off_obj, manny.base_costume) manny:stop_chore(msb_hand_off_obj, manny.base_costume) else manny:wait_for_chore(mcc_thunder_hand_off_obj, manny.base_costume) manny:stop_chore(mcc_thunder_hand_off_obj, manny.base_costume) end manny:walkto(arg1.use_pnt_x, arg1.use_pnt_y, arg1.use_pnt_z) manny:wait_for_actor() arg1:run_chore(1) arg1:close() END_CUT_SCENE() end ly.sh_door = Object:create(ly, "/lytx002/door", -0.098697402, -3.63239, 0.83999997, { range = 0.60000002 }) ly.sh_door.use_pnt_x = -0.098411702 ly.sh_door.use_pnt_y = -3.13359 ly.sh_door.use_pnt_z = 0.44999999 ly.sh_door.use_rot_x = 0 ly.sh_door.use_rot_y = 179.772 ly.sh_door.use_rot_z = 0 ly.sh_door.out_pnt_x = -0.097895198 ly.sh_door.out_pnt_y = -3.425 ly.sh_door.out_pnt_z = 0.44999999 ly.sh_door.out_rot_x = 0 ly.sh_door.out_rot_y = 179.772 ly.sh_door.out_rot_z = 0 ly.sh_door.touchable = FALSE ly.sh_box = ly.sh_door ly.sh_door.walkOut = function(arg1) -- line 2364 START_CUT_SCENE() ResetMarioControls() manny:say_line("/doma165/") manny:walkto(-0.100971, -3.23397, 0.45, 0, 6.21033, 0) END_CUT_SCENE() end CheckFirstTime("cn.lua") dofile("bogen.lua") dofile("spinner.lua") dofile("turbanman.lua") dofile("fatlady.lua") dofile("caneman.lua") dofile("mc_booth_idles.lua") dofile("cc_booth_idles.lua") dofile("ccharlie.lua") cn = Set:create("cn.set", "casino interior", { cn_top = 0, cn_cchms = 1, cn_rulws = 2 }) cn.shrinkable = 0.043 bogen.idle_table = Idle:create("bogen") bogen.idle_table:add_state("hands_side_to_bk", { rocking = 0.8, hands_bk_to_side = 0.2 }) bogen.idle_table:add_state("hands_to_hips", { hands_on_hips = 1 }) bogen.idle_table:add_state("rocking", { hands_bk_to_side = 1 }) bogen.idle_table:add_state("brush_jacket", { stand = 1 }) bogen.idle_table:add_state("hands_from_hips", { brush_jacket = 0.1, hands_to_hips = 0.1, hands_side_to_bk = 0.1, stand = 0.7 }) bogen.idle_table:add_state("hands_bk_to_side", { brush_jacket = 0.1, hands_to_hips = 0.1, hands_side_to_bk = 0.1, stand = 0.7 }) bogen.idle_table:add_state("stand", { brush_jacket = 0.1, hands_to_hips = 0.1, hands_side_to_bk = 0.1, stand = 0.7 }) bogen.idle_table:add_state("hands_on_hips", { hands_on_hips = 0.85, hands_from_hips = 0.15 }) manny.say_number = function(arg1, arg2) -- line 35 if arg2 == 1 then manny:say_line("/cnma001/") elseif arg2 == 2 then manny:say_line("/cnma002/") elseif arg2 == 3 then manny:say_line("/cnma003/") elseif arg2 == 4 then manny:say_line("/cnma004/") elseif arg2 == 5 then manny:say_line("/cnma005/") elseif arg2 == 6 then manny:say_line("/cnma006/") elseif arg2 == 7 then manny:say_line("/cnma007/") elseif arg2 == 8 then manny:say_line("/cnma008/") elseif arg2 == 9 then manny:say_line("/cnma009/") elseif arg2 == 10 then manny:say_line("/cnma010/") elseif arg2 == 11 then manny:say_line("/cnma011/") elseif arg2 == 12 then manny:say_line("/cnma012/") elseif arg2 == 13 then manny:say_line("/cnma013/") elseif arg2 == 14 then manny:say_line("/cnma014/") elseif arg2 == 15 then manny:say_line("/cnma015/") elseif arg2 == 16 then manny:say_line("/cnma016/") elseif arg2 == 17 then manny:say_line("/cnma017/") elseif arg2 == 18 then manny:say_line("/cnma018/") elseif arg2 == 19 then manny:say_line("/cnma019/") elseif arg2 == 20 then manny:say_line("/cnma020/") elseif arg2 == 21 then manny:say_line("/cnma021/") elseif arg2 == 22 then manny:say_line("/cnma022/") elseif arg2 == 23 then manny:say_line("/cnma023/") elseif arg2 == 24 then manny:say_line("/cnma024/") elseif arg2 == 25 then manny:say_line("/cnma025/") elseif arg2 == 26 then manny:say_line("/cnma026/") elseif arg2 == 27 then manny:say_line("/cnma027/") elseif arg2 == 28 then manny:say_line("/cnma028/") elseif arg2 == 29 then manny:say_line("/cnma029/") elseif arg2 == 30 then manny:say_line("/cnma030/") elseif arg2 == 31 then manny:say_line("/cnma031/") elseif arg2 == 32 then manny:say_line("/cnma032/") elseif arg2 == 33 then manny:say_line("/cnma033/") elseif arg2 == 34 then manny:say_line("/cnma034/") elseif arg2 == 35 then manny:say_line("/cnma035/") elseif arg2 == 36 then manny:say_line("/cnma036/") end end croupier.say_english_number = function(arg1, arg2) -- line 75 if arg2 == 0 then croupier:say_line("/cncr037/") elseif arg2 == 1 then croupier:say_line("/cncr038/") elseif arg2 == 2 then croupier:say_line("/cncr039/") elseif arg2 == 3 then croupier:say_line("/cncr040/") elseif arg2 == 4 then croupier:say_line("/cncr041/") elseif arg2 == 5 then croupier:say_line("/cncr042/") elseif arg2 == 6 then croupier:say_line("/cncr043/") elseif arg2 == 7 then croupier:say_line("/cncr044/") elseif arg2 == 8 then croupier:say_line("/cncr045/") elseif arg2 == 9 then croupier:say_line("/cncr046/") elseif arg2 == 10 then croupier:say_line("/cncr047/") elseif arg2 == 11 then croupier:say_line("/cncr048/") elseif arg2 == 12 then croupier:say_line("/cncr049/") elseif arg2 == 13 then croupier:say_line("/cncr050/") elseif arg2 == 14 then croupier:say_line("/cncr051/") elseif arg2 == 15 then croupier:say_line("/cncr052/") elseif arg2 == 16 then croupier:say_line("/cncr053/") elseif arg2 == 17 then croupier:say_line("/cncr054/") elseif arg2 == 18 then croupier:say_line("/cncr055/") elseif arg2 == 19 then croupier:say_line("/cncr056/") elseif arg2 == 20 then croupier:say_line("/cncr057/") elseif arg2 == 21 then croupier:say_line("/cncr058/") elseif arg2 == 22 then croupier:say_line("/cncr059/") elseif arg2 == 23 then croupier:say_line("/cncr060/") elseif arg2 == 24 then croupier:say_line("/cncr061/") elseif arg2 == 25 then croupier:say_line("/cncr062/") elseif arg2 == 26 then croupier:say_line("/cncr063/") elseif arg2 == 27 then croupier:say_line("/cncr064/") elseif arg2 == 28 then croupier:say_line("/cncr065/") elseif arg2 == 29 then croupier:say_line("/cncr066/") elseif arg2 == 30 then croupier:say_line("/cncr067/") elseif arg2 == 31 then croupier:say_line("/cncr068/") elseif arg2 == 32 then croupier:say_line("/cncr069/") elseif arg2 == 33 then croupier:say_line("/cncr070/") elseif arg2 == 34 then croupier:say_line("/cncr071/") elseif arg2 == 35 then croupier:say_line("/cncr072/") elseif arg2 == 36 then croupier:say_line("/cncr073/") end end croupier.say_french_number = function(arg1, arg2) -- line 116 if arg2 == 0 then croupier:say_line("/cncr074/") elseif arg2 == 1 then croupier:say_line("/cncr075/") elseif arg2 == 2 then croupier:say_line("/cncr076/") elseif arg2 == 3 then croupier:say_line("/cncr077/") elseif arg2 == 4 then croupier:say_line("/cncr078/") elseif arg2 == 5 then croupier:say_line("/cncr079/") elseif arg2 == 6 then croupier:say_line("/cncr080/") elseif arg2 == 7 then croupier:say_line("/cncr081/") elseif arg2 == 8 then croupier:say_line("/cncr082/") elseif arg2 == 9 then croupier:say_line("/cncr083/") elseif arg2 == 10 then croupier:say_line("/cncr084/") elseif arg2 == 11 then croupier:say_line("/cncr085/") elseif arg2 == 12 then croupier:say_line("/cncr086/") elseif arg2 == 13 then croupier:say_line("/cncr087/") elseif arg2 == 14 then croupier:say_line("/cncr088/") elseif arg2 == 15 then croupier:say_line("/cncr089/") elseif arg2 == 16 then croupier:say_line("/cncr090/") elseif arg2 == 17 then croupier:say_line("/cncr091/") elseif arg2 == 18 then croupier:say_line("/cncr092/") elseif arg2 == 19 then croupier:say_line("/cncr093/") elseif arg2 == 20 then croupier:say_line("/cncr094/") elseif arg2 == 21 then croupier:say_line("/cncr095/") elseif arg2 == 22 then croupier:say_line("/cncr096/") elseif arg2 == 23 then croupier:say_line("/cncr097/") elseif arg2 == 24 then croupier:say_line("/cncr098/") elseif arg2 == 25 then croupier:say_line("/cncr099/") elseif arg2 == 26 then croupier:say_line("/cncr100/") elseif arg2 == 27 then croupier:say_line("/cncr101/") elseif arg2 == 28 then croupier:say_line("/cncr102/") elseif arg2 == 29 then croupier:say_line("/cncr103/") elseif arg2 == 30 then croupier:say_line("/cncr104/") elseif arg2 == 31 then croupier:say_line("/cncr105/") elseif arg2 == 32 then croupier:say_line("/cncr106/") elseif arg2 == 33 then croupier:say_line("/cncr107/") elseif arg2 == 34 then croupier:say_line("/cncr108/") elseif arg2 == 35 then croupier:say_line("/cncr109/") elseif arg2 == 36 then croupier:say_line("/cncr110/") end end croupier.say_line = function(arg1, arg2) -- line 157 local local1 local local2 if not cn.pause_spinning then if system.currentSet == cn and cn:current_setup() == cn_rulws then Actor.say_line(arg1, arg2, { background = TRUE, volume = 100 }) elseif system.currentSet == cf and cf:current_setup() == cf_pnlcu then local1 = tostring(strsub(arg2, 1, 8) .. "a" .. strsub(arg2, 9, strlen(arg2))) local1 = arg2 Actor.say_line(arg1, local1, { background = TRUE }) end end end croupier.say_line_manny = function(arg1, arg2) -- line 180 Actor.say_line(arg1, arg2, { background = TRUE, volume = 100 }) end croupier.turn_to_table = function(arg1, arg2) -- line 184 croupier:set_turn_rate(15) if system.currentSet == cn then if arg2 == rtable1 then croupier:setrot(0, 0, 0, TRUE) elseif arg2 == rtable2 then croupier:setrot(0, 260, 0, TRUE) else croupier:setrot(0, 120, 0, TRUE) end while croupier:is_turning() and system.currentSet == cn do break_here() end end end bogen.say_line = function(arg1, arg2) -- line 202 local local1 if system.currentSet == cn and cn:current_setup() == cn_rulws then SayLine(arg1.hActor, arg2, TRUE) elseif system.currentSet == cf and cf:current_setup() == cf_pnlcu then local1 = tostring(strsub(arg2, 1, 8) .. "a" .. strsub(arg2, 9, strlen(arg2))) local1 = arg2 SayLine(arg1.hActor, local1, TRUE) end end croupier.say_color_french = function(arg1, arg2) -- line 215 local local1 = croupier:pick_color(arg2) if local1 == "red" then croupier:say_line("/cncr111/") elseif local1 == "black" then croupier:say_line("/cncr112/") end end croupier.say_color_english = function(arg1, arg2) -- line 225 local local1 = croupier:pick_color(arg2) if local1 == "red" then croupier:say_line("/cncr113/") elseif local1 == "black" then croupier:say_line("/cncr114/") end end croupier.pick_color = function(arg1, arg2) -- line 235 if arg2 == 0 then return "zero" elseif arg2 == 1 or arg2 == 3 or arg2 == 5 or arg2 == 7 or arg2 == 9 or arg2 == 12 or arg2 == 14 or arg2 == 16 or arg2 == 18 or arg2 == 19 or arg2 == 21 or arg2 == 23 or arg2 == 25 or arg2 == 27 or arg2 == 30 or arg2 == 32 or arg2 == 34 or arg2 == 36 then return "red" else return "black" end end croupier.even_odd_manque_passe = function(arg1, arg2) -- line 263 if floor(mod(arg2, 2)) == 0 then if arg2 > 18 then croupier:say_line("/cncr115/") else croupier:say_line("/cncr116/") end elseif arg2 > 18 then croupier:say_line("/cncr117/") else croupier:say_line("/cncr118/") end end cn.BET = 0 cn.SPIN = 1 cn.WIN = 2 cn.bets = { } cn.bets[1] = "red" cn.bets[2] = "black" cn.bets[3] = "zero" cn.bets[4] = "num" cn.casino_patrons = function(arg1, arg2) -- line 290 local local1 = { } local local2 = { } local local3 local2[1] = turbanman local2[2] = caneman local2[3] = fatlady if bogen.pissed and not cn.bogens_in_the_house_again then if arg2 == rtable1 then local1[1] = turbanman elseif arg2 == rtable2 then local1[1] = caneman elseif arg2 == rtable3 then local1[1] = fatlady end elseif arg2 == rtable1 then local1[1] = turbanman elseif arg2 == rtable3 then local1[1] = caneman local1[2] = fatlady end local3 = 1 while local1[local3] do local1[local3]:thaw(TRUE) if arg1 == cn.BET then local1[local3].bet = pick_from_nonweighted_table(cn.bets) if local1[local3].bet == "num" then local1[local3].bet = rndint(0, 36) end if system.currentSet == cn and cn:current_setup() ~= cn_cchms then if rnd() then local1[local3]:play_chore(1) else local1[local3]:play_chore(2) end end elseif arg1 == cn.SPIN and system.currentSet == cn and cn:current_setup() ~= cn_cchms then local1[local3]:play_chore(3) elseif arg1 == cn.WIN and system.currentSet == cn and cn:current_setup() ~= cn_cchms then local1[local3]:play_chore(4) elseif system.currentSet ~= cn then sleep_for(2000) end if system.currentSet == cn and cn:current_setup() ~= cn_cchms then local1[local3]:wait_for_chore() local1[local3]:freeze() end local3 = local3 + 1 end end determine_winner = function(arg1) -- line 345 local local1 = { } local local2 = { } local local3 local local4 local2[1] = turbanman local2[2] = caneman local2[3] = fatlady if bogen.pissed and not cn.bogens_in_the_house_again then if arg1 == rtable1 then local1[1] = turbanman elseif arg1 == rtable2 then local1[1] = caneman elseif arg1 == rtable3 then local1[1] = fatlady end elseif arg1 == rtable1 then local1[1] = turbanman elseif arg1 == rtable3 then local1[1] = caneman local1[2] = fatlady end local3 = 1 while local1[local3] do if type(local1[local3].bet) == "number" then if local1[local3].bet == arg1.current_value then return TRUE end else local4 = croupier:pick_color(arg1.current_value) if local1[local3].bet == local4 then return TRUE end end local3 = local3 + 1 end return FALSE end roulette_tables = { } current_roulette_table = nil gambling_table_number = nil cn.roulette_game_simulator = function() -- line 394 local local1, local2 local local3 local local4 local local5 = FALSE if not rtable1 then rtable1 = Roulette:create("table 1") rtable1.currrent_value = rndint(0, 36) rtable2 = Roulette:create("table 2") rtable2.currrent_value = rndint(0, 36) rtable3 = Roulette:create("table 3") rtable3.currrent_value = rndint(0, 36) roulette_tables[1] = rtable1 roulette_tables[2] = rtable2 roulette_tables[3] = rtable3 gambling_table_number, local3 = next(roulette_tables, nil) end if system.currentSet == cn then rtable1:init_actor() rtable2:init_actor() rtable3:init_actor() turbanman:freeze() caneman:freeze() fatlady:freeze() rtable1.actor:setpos(-0.29497501, -0.16027699, 0.3238) rtable2.actor:setpos(0.0019249, -0.67287701, 0.3238) rtable3.actor:setpos(-0.58057499, -0.66287702, 0.3238) bogen_in_cn = TRUE rtable2:magnetize(2) end if not current_roulette_table then bogen_table = rtable2 current_roulette_table = rtable1 local4 = rtable3 rtable1:spin() rtable2:spin() rtable3:spin() end sleep_for(1000) while 1 do if current_roulette_table == bogen_table and bogen_in_cn then current_roulette_table:magnetize(2) end local2 = start_script(current_roulette_table.stop, current_roulette_table) if system.currentSet == cn then local1 = start_script(croupier.turn_to_table, croupier, current_roulette_table) wait_for_script(local1) else sleep_for(3000) end wait_for_script(local2) if system.currentSet == cn then end start_script(cn.casino_patrons, cn.SPIN, local4) if current_roulette_table == bogen_table and bogen_in_cn and current_roulette_table.current_value == 2 then if system.currentSet == cn then croupier:thaw(TRUE) end croupier:say_line("/cncr125/") wait_for_message() croupier:say_line("/cncr126/") wait_for_message() croupier:say_line("/cncr127/") if system.currentSet == cn and cn:current_setup() ~= cn_cchms then croupier:play_chore(1) croupier:wait_for_chore() end wait_for_message() if system.currentSet == cn then end bogen:say_line(pick_one_of({ "/cnbo128/", "/cnbo129/", "/cnbo130/", "/cnbo131/", "/cnbo132/", "/cnbo133/", "/cnbo134/" })) wait_for_message() else if system.currentSet == cn then croupier:thaw(TRUE) end croupier:say_line("/cncr135/") wait_for_message() croupier:say_french_number(current_roulette_table.current_value) wait_for_message() croupier:say_color_french(current_roulette_table.current_value) wait_for_message() croupier:even_odd_manque_passe(current_roulette_table.current_value) wait_for_message() croupier:say_english_number(current_roulette_table.current_value) wait_for_message() croupier:say_color_english(current_roulette_table.current_value) wait_for_message() if current_roulette_table == bogen_table and bogen_in_cn then if not bogen.pissed then local1 = start_script(cf.piss_off_bogen) wait_for_script(local1) bogen:free() bogen_in_cn = FALSE else start_script(cf.really_piss_off_bogen) return TRUE end else local5 = determine_winner(current_roulette_table) if local5 then local5 = FALSE croupier:say_line("/cncr136/") wait_for_message() croupier:say_line("/cncr137/") wait_for_message() end if system.currentSet == cn then end local1 = start_script(cn.casino_patrons, cn.WIN, current_roulette_table) wait_for_script(local1) end end sleep_for(1000) if system.currentSet == cn then croupier:thaw(TRUE) end croupier:say_line("/cncr119/") wait_for_message() croupier:say_line("/cncr120/") wait_for_message() if system.currentSet == cn then end local1 = start_script(cn.casino_patrons, cn.BET, current_roulette_table) wait_for_script(local1) if system.currentSet == cn then croupier:thaw(TRUE) end croupier:say_line("/cncr121/") wait_for_message() croupier:say_line("/cncr122/") wait_for_message() croupier:say_line("/cncr123/") wait_for_message() croupier:say_line("/cncr124/") croupier:wait_for_message() if system.currentSet == cn and cn:current_setup() ~= cn_cchms then croupier:play_chore(1) sleep_for(600) start_sfx("cnRoulet.imu") sleep_for(1008) end current_roulette_table:spin() local4 = current_roulette_table gambling_table_number, local3 = next(roulette_tables, gambling_table_number) if not local3 then gambling_table_number, local3 = next(roulette_tables, nil) end current_roulette_table = local3 if system.currentSet == cn then croupier:wait_for_chore() end end end cn.charlie_idles = function() -- line 570 local local1 charlie.stop_idle = FALSE charlie:stop_chore(cc_booth_idles_sit_pose) while not charlie.stop_idle do charlie:play_chore(cc_booth_idles_smoke) charlie:wait_for_chore() local1 = rndint(10, 30) repeat sleep_for(10) local1 = local1 - 1 until local1 < 0 or charlie.stop_idle end end cn.set_up_actors = function(arg1) -- line 587 if bogen.pissed then if cn.bogens_in_the_house_again then cn.bogen_obj:make_touchable() bogen:set_costume("bogen.cos") bogen:put_in_set(cn) bogen:setpos(0.370565, -0.611363, 0) bogen:set_mumble_chore(bogen_mumble) bogen:set_talk_chore(1, bogen_stop_talk) bogen:set_talk_chore(2, bogen_a) bogen:set_talk_chore(3, bogen_c) bogen:set_talk_chore(4, bogen_e) bogen:set_talk_chore(5, bogen_f) bogen:set_talk_chore(6, bogen_l) bogen:set_talk_chore(7, bogen_m) bogen:set_talk_chore(8, bogen_o) bogen:set_talk_chore(9, bogen_t) bogen:set_talk_chore(10, bogen_u) start_script(bogen.new_run_idle, bogen, "stand", bogen.idle_table) bogen_in_cn = TRUE rtable2:magnetize(2) else cn.bogen_obj:make_untouchable() end else bogen_in_cn = TRUE if not bogen.hCos then bogen.hCos = "bogen.cos" end bogen:set_costume(bogen.hCos) bogen:put_in_set(cn) bogen:setpos(0.370565, -0.611363, 0) bogen:setrot(0, 160, 0) bogen:set_mumble_chore(bogen_mumble) bogen:set_talk_chore(1, bogen_stop_talk) bogen:set_talk_chore(2, bogen_a) bogen:set_talk_chore(3, bogen_c) bogen:set_talk_chore(4, bogen_e) bogen:set_talk_chore(5, bogen_f) bogen:set_talk_chore(6, bogen_l) bogen:set_talk_chore(7, bogen_m) bogen:set_talk_chore(8, bogen_o) bogen:set_talk_chore(9, bogen_t) bogen:set_talk_chore(10, bogen_u) start_script(bogen.new_run_idle, bogen, "stand", bogen.idle_table, "bogen.cos") end if not tix_printer then tix_printer = Actor:create(nil, nil, nil, "printer") end if cn.printer.owner ~= manny then tix_printer:set_costume("mc_booth_idles.cos") tix_printer:setpos(0.863729, -0.142364, 0.00900003) tix_printer:setrot(0, 0.29, 0) tix_printer:set_visibility(FALSE) tix_printer:put_in_set(cn) tix_printer:play_chore(mc_booth_idles_printer_only) end croupier:set_costume("spinner.cos") croupier:set_mumble_chore(spinner_mumble) croupier:set_talk_chore(1, spinner_stop_talk) croupier:set_talk_chore(2, spinner_a) croupier:set_talk_chore(3, spinner_c) croupier:set_talk_chore(4, spinner_e) croupier:set_talk_chore(5, spinner_f) croupier:set_talk_chore(6, spinner_l) croupier:set_talk_chore(7, spinner_m) croupier:set_talk_chore(8, spinner_o) croupier:set_talk_chore(9, spinner_t) croupier:set_talk_chore(10, spinner_u) croupier:set_head(3, 4, 5, 200, 28, 80) croupier:set_turn_chores(spinner_swvl_left, spinner_swvl_right) croupier:set_turn_rate(15) croupier:put_in_set(cn) croupier:follow_boxes() croupier:setpos(-0.199975, -0.468877, 0) if hh.union_card.owner == manny then cn.charlie_obj:make_untouchable() else charlie:set_costume("ccharlie.cos") charlie:set_mumble_chore(ccharlie_mumble) charlie:set_talk_chore(1, ccharlie_no_talk) charlie:set_talk_chore(2, ccharlie_a) charlie:set_talk_chore(3, ccharlie_c) charlie:set_talk_chore(4, ccharlie_e) charlie:set_talk_chore(5, ccharlie_f) charlie:set_talk_chore(6, ccharlie_l) charlie:set_talk_chore(7, ccharlie_m) charlie:set_talk_chore(8, ccharlie_o) charlie:set_talk_chore(9, ccharlie_t) charlie:set_talk_chore(10, ccharlie_u) charlie:push_costume("cc_booth_idles.cos") charlie:put_in_set(cn) charlie:setpos(0.917252, 0.259107, -0.0515) charlie:setrot(0, 180, 0) start_script(cn.charlie_idles) end if not turbanman then turbanman = Actor:create(nil, nil, nil, "turbanman") caneman = Actor:create(nil, nil, nil, "caneman") fatlady = Actor:create(nil, nil, nil, "fatlady") end turbanman:set_costume("turbanman.cos") turbanman:put_in_set(cn) turbanman:setpos(-0.510075, 0.124623, 0) turbanman:setrot(0, 220, 0) turbanman:play_chore(turbanman_base_pose) caneman:set_costume("caneman.cos") caneman:put_in_set(cn) if bogen.pissed and not cn.bogens_in_the_house_again then caneman:setpos(-0.0635751, -0.992476, 0) caneman:setrot(0, 300, 0) else caneman:setpos(-0.695394, -0.293976, 0) caneman:setrot(0, 180, 0) end caneman:play_chore(caneman_base_pose) fatlady:set_costume("fatlady.cos") fatlady:put_in_set(cn) fatlady:setpos(-0.915694, -0.588876, 0) fatlady:setrot(0, 215, 0) fatlady:play_chore(fatlady_base_pose) if rtable1 then rtable1:init_actor() rtable2:init_actor() rtable3:init_actor() rtable1.actor:setpos(-0.294975, -0.160277, 0.3238) rtable2.actor:setpos(0.0019249, -0.672877, 0.3238) rtable3.actor:setpos(-0.580575, -0.662877, 0.3238) if current_roulette_table == rtable1 then croupier:setrot(0, 0, 0) elseif current_roulette_table == rtable2 then croupier:setrot(0, 260, 0) else croupier:setrot(0, 120, 0) end end end cn.return_bogen = function() -- line 743 made_vacancy = TRUE hh.union_card.owner = manny dd.strike_on = TRUE end cn.enter = function(arg1) -- line 749 cn.pause_spinning = FALSE if made_vacancy and hh.union_card.owner == manny and dd.strike_on then cn.bogens_in_the_house_again = TRUE end if not find_script(cn.roulette_game_simulator) then start_script(cn.roulette_game_simulator) end cn:set_up_actors() preload_sfx("cnRoulet.imu") preload_sfx("cnRouStp.wav") end cn.exit = function(arg1) -- line 764 bogen:free() croupier:free() charlie:free() caneman:free() turbanman:free() fatlady:free() rtable1.actor:free() rtable2.actor:free() rtable3.actor:free() stop_script(cn.charlie_idles) stop_sound("cnRoulet.imu") stop_sound("cnRouStp.wav") tix_printer:free() end cn.charlie_obj = Object:create(cn, "Charlie", 0.85364002, 0.21664301, 0.38, { range = 0.80000001 }) cn.charlie_obj.use_pnt_x = 0.92835897 cn.charlie_obj.use_pnt_y = -0.266837 cn.charlie_obj.use_pnt_z = 0 cn.charlie_obj.use_rot_x = 0 cn.charlie_obj.use_rot_y = 378.05701 cn.charlie_obj.use_rot_z = 0 cn.charlie_obj.lookAt = function(arg1) -- line 792 manny:say_line("/cnma138/") end cn.charlie_obj.pickUp = function(arg1) -- line 796 manny:say_line("/cnma139/") end cn.charlie_obj.use = function(arg1) -- line 800 if arg1.talked_out then manny:say_line("/drma001/") else START_CUT_SCENE() charlie.stop_idle = TRUE manny:walkto_object(arg1) manny:wait_for_actor() wait_for_script(cn.charlie_idles) Dialog:run("ch1", "dlg_charlie.lua") END_CUT_SCENE() end end cn.printer = Object:create(cn, "printer", 0, 0, 0, { range = 0 }) cn.printer.lookAt = function(arg1) -- line 818 if tb.tried_ticket then manny:say_line("/cnma140/") else manny:say_line("/cnma141/") end end cn.printer.use = function(arg1) -- line 826 if cn.ticket.owner == manny then START_CUT_SCENE() shrinkBoxesEnabled = FALSE open_inventory(TRUE, TRUE) manny.is_holding = cn.ticket close_inventory() manny:stop_chore(manny.hold_chore, "mc.cos") manny:stop_chore(mc_hold, "mc.cos") manny.is_holding = nil cn.ticket:free() manny:play_chore(mc_toss_stub, "mc.cos") manny:wait_for_chore() manny:fade_out_chore(mc_toss_stub, "mc.cos", 300) open_inventory(TRUE, TRUE) manny.is_holding = cn.printer close_inventory() if GlobalShrinkEnabled then shrinkBoxesEnabled = TRUE shrink_box_toggle() end END_CUT_SCENE() end inventory_save_set = system.currentSet inventory_save_setup = system.currentSet:current_setup() inventory_save_pos = manny:getpos() inventory_save_handler = system.buttonHandler system.buttonHandler = tpButtonHandler tp:switch_to_set() end cn.printer.default_response = function(arg1) -- line 858 if tb.tried_ticket then manny:say_line("/cnma142/") else manny:say_line("/cnma143/") end end cn.ticket = Object:create(cn, "betting stub", 0, 0, 0, { range = 0 }) cn.ticket.string_name = "ticket" cn.ticket.temp_id_number = 0 cn.ticket.wav = "getCard.wav" cn.ticket.lookAt = function(arg1) -- line 871 START_CUT_SCENE() manny:say_line("/cnma144/") manny:wait_for_message() if arg1.day == 1 then manny:say_line("/cnma145/") elseif arg1.day == 2 then manny:say_line("/cnma146/") elseif arg1.day == 3 then manny:say_line("/cnma147/") elseif arg1.day == 4 then manny:say_line("/cnma148/") elseif arg1.day == 5 then manny:say_line("/cnma149/") elseif arg1.day == 6 then manny:say_line("/cnma150/") elseif arg1.day == 7 then manny:say_line("/cnma151/") end manny:wait_for_message() manny:say_line("/cnma152/") manny:wait_for_message() manny:say_number(arg1.week) manny:wait_for_message() manny:say_line("/cnma153/") manny:wait_for_message() manny:say_number(arg1.race) END_CUT_SCENE() end cn.ticket.use = cn.ticket.lookAt cn.pass = Object:create(cn, "V.I.P. pass", 0, 0, 0, { range = 0 }) cn.pass.string_name = "pass" cn.pass.wav = "getCard.wav" cn.pass.lookAt = function(arg1) -- line 900 soft_script() manny:say_line("/cnma154/") wait_for_message() manny:say_line("/bima075/") end cn.pass.use = function(arg1) -- line 908 manny:say_line("/cnma155/") end cn.pass.default_response = cn.pass.use cn.croupier_obj = Object:create(cn, "Roulette croupier", -0.22641701, -0.450957, 0.41999999, { range = 0.60000002 }) cn.croupier_obj.use_pnt_x = 0.063582897 cn.croupier_obj.use_pnt_y = -0.30095699 cn.croupier_obj.use_pnt_z = 0 cn.croupier_obj.use_rot_x = 0 cn.croupier_obj.use_rot_y = -229.771 cn.croupier_obj.use_rot_z = 0 cn.croupier_obj.lookAt = function(arg1) -- line 922 soft_script() manny:say_line("/cnma156/") wait_for_message() manny:say_line("/cnma157/") end cn.croupier_obj.use = function(arg1) -- line 929 START_CUT_SCENE() cn.pause_spinning = TRUE manny:walkto_object(arg1) croupier:wait_for_message() manny:say_line("/cnma158/") wait_for_message() croupier:head_look_at_manny() if bogen.pissed then if not cn.bogens_in_the_house_again then croupier:say_line_manny("/cncr159/") wait_for_message() manny:say_line("/cnma160/") wait_for_message() croupier:say_line_manny("/cncr161/") else croupier:say_line_manny("/cncr162/") wait_for_message() croupier:say_line_manny("/cncr163/") end else croupier:say_line_manny("/cncr164/") end croupier:head_look_at(nil) wait_for_message() sleep_for(500) cn.pause_spinning = FALSE END_CUT_SCENE() end cn.gamblers = Object:create(cn, "gamblers", -0.531515, 0.110031, 0.38999999, { range = 0.80000001 }) cn.gamblers.use_pnt_x = 0.0084851598 cn.gamblers.use_pnt_y = 0.110031 cn.gamblers.use_pnt_z = 0 cn.gamblers.use_rot_x = 0 cn.gamblers.use_rot_y = 129.875 cn.gamblers.use_rot_z = 0 cn.gamblers.lookAt = function(arg1) -- line 969 manny:say_line("/cnma165/") wait_for_message() manny:say_line("/cnma166/") end cn.gamblers.pickUp = function(arg1) -- line 975 manny:say_line("/cnma167/") end cn.gamblers.use = function(arg1) -- line 979 manny:say_line("/cnma168/") end cn.bogen_obj = Object:create(cn, "Bogen", 0.370565, -0.61136299, 0.34999999, { range = 0.60000002 }) cn.bogen_obj.use_pnt_x = 0.41056499 cn.bogen_obj.use_pnt_y = -0.30136299 cn.bogen_obj.use_pnt_z = 0 cn.bogen_obj.use_rot_x = 0 cn.bogen_obj.use_rot_y = 185.45 cn.bogen_obj.use_rot_z = 0 cn.bogen_obj.lookAt = function(arg1) -- line 991 soft_script() manny:say_line("/cnma169/") wait_for_message() manny:say_line("/cnma170/") end cn.bogen_obj.pickUp = cn.gamblers.pickUp cn.bogen_obj.use = function(arg1) -- line 1000 START_CUT_SCENE() if cn.bogens_in_the_house_again and bogen.pissed then manny:say_line("/cnma171/") wait_for_message() bogen:say_line("/cnbo172/") else manny:say_line("/cnma173/") wait_for_message() bogen:say_line("/cnbo174/") end END_CUT_SCENE() end cn.bogen_obj.use_key = function(arg1) -- line 1015 soft_script() manny:say_line("/slma205/") manny:wait_for_message() manny:say_line("/slma206/") end cn.ci_door = Object:create(cn, "/cntx249/door", -0.58838499, 1.69042, 0.63999999, { range = 0.60000002 }) cn.ci_door.use_pnt_x = -0.640468 cn.ci_door.use_pnt_y = 0.35423601 cn.ci_door.use_pnt_z = 0 cn.ci_door.use_rot_x = 0 cn.ci_door.use_rot_y = 2.3106101 cn.ci_door.use_rot_z = 0 cn.ci_door.out_pnt_x = -0.62948501 cn.ci_door.out_pnt_y = 1.61693 cn.ci_door.out_pnt_z = 0.1 cn.ci_door.out_rot_x = 0 cn.ci_door.out_rot_y = 8.0328197 cn.ci_door.out_rot_z = 0 cn.ci_box = cn.ci_door cn.ci_door.walkOut = function(arg1) -- line 1044 START_CUT_SCENE() manny:walkto_object(cn.ci_door, TRUE) manny:wait_for_actor() END_CUT_SCENE() ci:come_out_door(ci.cn_door) end
gpl-2.0
TheAnswer/FirstTest
bin/scripts/items/objects/clothing/twilekHats/twilekHat5.lua
1
2297
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. twilekHat5 = Clothing:new { objectName = "Grand Twi'Lek Headpiece", templateName = "twilek_hat_s05", objectCRC = "851931994", objectType = HEADWEAR, equipped = "0", itemMask = TWILEKS }
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/tatooine/npcs/mosTaike/mosTaikeGuardYoung.lua
1
4563
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. mosTaikeGuardYoung = Creature:new { objectName = "mosTaikeGuardYoung", -- Lua Object Name creatureType = "NPC", gender = "", speciesName = "mos_taike_guard_young", stfName = "mob/creature_names", objectCRC = 3344047957, socialGroup = "Townsperson", level = 21, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 7200, healthMin = 5900, strength = 0, constitution = 0, actionMax = 7200, actionMin = 5900, quickness = 0, stamina = 0, mindMax = 7200, mindMin = 5900, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 20, energy = 20, electricity = -1, stun = -1, blast = 0, heat = -1, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 190, weaponMaxDamage = 200, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "mosTaikeAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(mosTaikeGuardYoung, 3344047957) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/armorsmith/personalArmorIvPadded/ithorianDefenderChestPlate.lua
1
5192
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. ithorianDefenderChestPlate = Object:new { objectName = "Ithorian Defender Chest Plate", stfName = "ith_armor_s01_chest_plate", stfFile = "wearables_name", objectCRC = 264113310, groupName = "craftArmorPersonalGroupE", -- Group schematic is awarded in (See skills table) craftingToolTab = 2, -- (See DraftSchemticImplementation.h) complexity = 40, size = 4, xpType = "crafting_clothing_armor", xp = 700, assemblySkill = "armor_assembly", experimentingSkill = "armor_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "auxilary_coverage, body, liner, hardware_and_attachments, binding_and_reinforcement, padding, armor, load_bearing_harness, reinforcement", ingredientSlotType = "0, 0, 0, 0, 0, 0, 1, 2, 2", resourceTypes = "hide_leathery_lok, hide_scaley, fiberplast_corellia, metal, petrochem_inert_polymer, hide_wooly, object/tangible/component/armor/shared_armor_segment_padded.iff, object/tangible/component/clothing/shared_synthetic_cloth.iff, object/tangible/component/clothing/shared_reinforced_fiber_panels.iff", resourceQuantities = "80, 80, 40, 50, 50, 50, 4, 1, 1", combineTypes = "0, 0, 0, 0, 0, 0, 1, 1, 1", contribution = "100, 100, 100, 100, 100, 100, 100, 100, 100", numberExperimentalProperties = "1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1", experimentalProperties = "XX, XX, XX, OQ, SR, OQ, SR, OQ, UT, MA, OQ, MA, OQ, MA, OQ, XX, XX, OQ, SR, XX", experimentalWeights = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalGroupTitles = "null, null, null, exp_durability, exp_quality, exp_durability, exp_durability, exp_durability, exp_durability, null, null, exp_resistance, null", experimentalSubGroupTitles = "null, null, sockets, hit_points, armor_effectiveness, armor_integrity, armor_health_encumbrance, armor_action_encumbrance, armor_mind_encumbrance, armor_rating, armor_special_type, armor_special_effectiveness, armor_special_integrity", experimentalMin = "0, 0, 0, 1000, 1, 18750, 172, 66, 23, 1, 4, 1, 18750", experimentalMax = "0, 0, 0, 1000, 30, 31250, 103, 39, 14, 1, 4, 40, 31250", experimentalPrecision = "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", tanoAttributes = "objecttype=257:objectcrc=2075456355:stfFile=wearables_name:stfName=ith_armor_s01_chest_plate:stfDetail=:itemmask=63491:customattributes=specialprotection=kineticeffectiveness;vunerability=heateffectiveness,stuneffectiveness,coldeffectiveness;armorPiece=256;armorStyle=4106;:", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "", customizationDefaults = "", customizationSkill = "armor_customization" } DraftSchematics:addDraftSchematic(ithorianDefenderChestPlate, 264113310)--- Add to global DraftSchematics table
lgpl-3.0
schaeftide/factorio-teams
stdlib/area/area.lua
1
6856
--- Area module -- @module area require 'stdlib/core' require 'stdlib/area/position' Area = {} --- Returns the size of the space contained in the 2d area -- @param area the area -- @return size of the area function Area.area(area) fail_if_missing(area, "missing area value") area = Area.to_table(area) local left_top = Position.to_table(area.left_top) local right_bottom = Position.to_table(area.right_bottom) local dx = math.abs(left_top.x - right_bottom.x) local dy = math.abs(left_top.y - right_bottom.y) return dx * dy end --- Tests if a position {x, y} is inside (inclusive) of area -- @param area the area -- @param pos the position to check -- @return true if the position is inside of the area function Area.inside(area, pos) fail_if_missing(pos, "missing pos value") fail_if_missing(area, "missing area value") pos = Position.to_table(pos) area = Area.to_table(area) local left_top = Position.to_table(area.left_top) local right_bottom = Position.to_table(area.right_bottom) return pos.x >= left_top.x and pos.y >= left_top.y and pos.x <= right_bottom.x and pos.y <= right_bottom.y end --- Shrinks the size of an area by the given amount -- @param area the area -- @param amount to shrink each edge of the area inwards by -- @return the shrunk area function Area.shrink(area, amount) fail_if_missing(area, "missing area value") fail_if_missing(amount, "missing amount value") if amount < 0 then error("Can not shrunk area by a negative amount (see Area.expand)!", 2) end area = Area.to_table(area) local left_top = Position.to_table(area.left_top) local right_bottom = Position.to_table(area.right_bottom) return {left_top = {x = left_top.x + amount, y = left_top.y + amount}, right_bottom = {x = right_bottom.x - amount, y = right_bottom.y - amount}} end --- Expands the size of an area by the given amount -- @param area the area -- @param amount to expand each edge of the area outwards by -- @return the expanded area function Area.expand(area, amount) fail_if_missing(area, "missing area value") fail_if_missing(amount, "missing amount value") if amount < 0 then error("Can not expand area by a negative amount (see Area.shrink)!", 2) end area = Area.to_table(area) local left_top = Position.to_table(area.left_top) local right_bottom = Position.to_table(area.right_bottom) return {left_top = {x = left_top.x - amount, y = left_top.y - amount}, right_bottom = {x = right_bottom.x + amount, y = right_bottom.y + amount}} end --- Calculates the center of the area and returns the position -- @param area the area -- @return area to find the center for function Area.center(area) fail_if_missing(area, "missing area value") area = Area.to_table(area) local dist_x = area.right_bottom.x - area.left_top.x local dist_y = area.right_bottom.y - area.left_top.y return {x = area.left_top.x + (dist_x / 2), y = area.left_top.y + (dist_y / 2)} end --- Offsets the area by the {x, y} values -- @param area the area -- @param pos the {x, y} amount to offset the area -- @return offset area by the position values function Area.offset(area, pos) fail_if_missing(area, "missing area value") fail_if_missing(pos, "missing pos value") area = Area.to_table(area) return {left_top = Position.add(area.left_top, pos), right_bottom = Position.add(area.right_bottom, pos)} end --- Converts an area to the integer representation, by taking the floor of the left_top and the ceiling of the right_bottom -- @param area the area -- @return the rounded integer representation function Area.round_to_integer(area) fail_if_missing(area, "missing area value") area = Area.to_table(area) local left_top = Position.to_table(area.left_top) local right_bottom = Position.to_table(area.right_bottom) return {left_top = {x = math.floor(left_top.x), y = math.floor(left_top.y)}, right_bottom = {x = math.ceil(right_bottom.x), y = math.ceil(right_bottom.y)}} end --- Iterates an area. -- @usage ---for x,y in Area.iterate({{0, -5}, {3, -3}}) do -----... ---end -- @param area the area -- @return iterator function Area.iterate(area) fail_if_missing(area, "missing area value") local iterator = {idx = 0} function iterator.iterate(area) local rx = area.right_bottom.x - area.left_top.x + 1 local dx = iterator.idx % rx local dy = math.floor(iterator.idx / rx) iterator.idx = iterator.idx + 1 if (area.left_top.y + dy) > area.right_bottom.y then return end return (area.left_top.x + dx), (area.left_top.y + dy) end return iterator.iterate, Area.to_table(area), 0 end --- Iterates an area in a spiral inner-most to outer-most fashion. ---<p><i>Example:</i></p> ---<pre> ---for x, y in Area.spiral_iterate({{-2, -1}, {2, 1}}) do ---- print("(" .. x .. ", " .. y .. ")") ---end --- prints: (0, 0) (1, 0) (1, 1) (0, 1) (-1, 1) (-1, 0) (-1, -1) (0, -1) (1, -1) (2, -1) (2, 0) (2, 1) (-2, 1) (-2, 0) (-2, -1) ---</pre> -- iterates in the order depicted:<br/> -- ![](http://i.imgur.com/EwfO0Es.png) -- @param area the area -- @return iterator function Area.spiral_iterate(area) fail_if_missing(area, "missing area value") area = Area.to_table(area) local rx = area.right_bottom.x - area.left_top.x + 1 local ry = area.right_bottom.y - area.left_top.y + 1 local half_x = math.floor(rx / 2) local half_y = math.floor(ry / 2) local center_x = area.left_top.x + half_x local center_y = area.left_top.y + half_y local x = 0 local y = 0 local dx = 0 local dy = -1 local iterator = {list = {}, idx = 1} for i = 1, math.max(rx, ry) * math.max(rx, ry) do if -(half_x) <= x and x <= half_x and -(half_y) <= y and y <= half_y then table.insert(iterator.list, {x, y}) end if x == y or (x < 0 and x == -y) or (x > 0 and x == 1 - y) then local temp = dx dx = -(dy) dy = temp end x = x + dx y = y + dy end function iterator.iterate(area) if #iterator.list < iterator.idx then return end local x, y = unpack(iterator.list[iterator.idx]) iterator.idx = iterator.idx + 1 return (center_x + x), (center_y + y) end return iterator.iterate, Area.to_table(area), 0 end --- Converts an area in the array format to an array in the table format -- @param area_arr the area to convert -- @return a converted position, { x = pos_arr[1], y = pos_arr[2] } function Area.to_table(area_arr) fail_if_missing(area_arr, "missing area value") if #area_arr == 2 then return { left_top = Position.to_table(area_arr[1]), right_bottom = Position.to_table(area_arr[2]) } end return area_arr end return Area
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/npcs/imperial/imperialStormtrooperDarkTrooperNovatrooper.lua
1
4681
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. imperialStormTrooperDarkTrooperNovatrooper = Creature:new { objectName = "imperialStormTrooperDarkTrooperNovatrooper", -- Lua Object Name creatureType = "NPC", faction = "imperial", factionPoints = 20, gender = "", speciesName = "stormtrooper_dark_trooper_novatrooper", stfName = "mob/creature_names", objectCRC = 1312348723, socialGroup = "imperial", level = 1, combatFlags = 0, healthMax = 245000, healthMin = 235000, strength = 0, constitution = 0, actionMax = 245000, actionMin = 235000, quickness = 0, stamina = 0, mindMax = 245000, mindMin = 235000, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 3, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 95, energy = 85, electricity = 10, stun = 45, blast = 80, heat = 30, cold = 10, acid = 30, lightsaber = -1, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/ranged/carbine/shared_carbine_e11.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "a e11 Carbine", -- Name ex. 'a Vibrolance' weaponTemp = "carbine_e11", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "CarbineRangedWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 1, weaponMinDamage = 1270, weaponMaxDamage = 2250, weaponAttackSpeed = 2, weaponDamageType = "ENERGY", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "LIGHT", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "imperialStormTrooperDarkTrooperNovaTrooperAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(imperialStormTrooperDarkTrooperNovatrooper, 1312348723) -- Add to Global Table
lgpl-3.0
bartvm/Penlight
lua/pl/app.lua
26
5794
--- Application support functions. -- See @{01-introduction.md.Application_Support|the Guide} -- -- Dependencies: `pl.utils`, `pl.path` -- @module pl.app local io,package,require = _G.io, _G.package, _G.require local utils = require 'pl.utils' local path = require 'pl.path' local app = {} local function check_script_name () if _G.arg == nil then error('no command line args available\nWas this run from a main script?') end return _G.arg[0] end --- add the current script's path to the Lua module path. -- Applies to both the source and the binary module paths. It makes it easy for -- the main file of a multi-file program to access its modules in the same directory. -- `base` allows these modules to be put in a specified subdirectory, to allow for -- cleaner deployment and resolve potential conflicts between a script name and its -- library directory. -- @string base optional base directory. -- @treturn string the current script's path with a trailing slash function app.require_here (base) local p = path.dirname(check_script_name()) if not path.isabs(p) then p = path.join(path.currentdir(),p) end if p:sub(-1,-1) ~= path.sep then p = p..path.sep end if base then p = p..base..path.sep end local so_ext = path.is_windows and 'dll' or 'so' local lsep = package.path:find '^;' and '' or ';' local csep = package.cpath:find '^;' and '' or ';' package.path = ('%s?.lua;%s?%sinit.lua%s%s'):format(p,p,path.sep,lsep,package.path) package.cpath = ('%s?.%s%s%s'):format(p,so_ext,csep,package.cpath) return p end --- return a suitable path for files private to this application. -- These will look like '~/.SNAME/file', with '~' as with expanduser and -- SNAME is the name of the script without .lua extension. -- @string file a filename (w/out path) -- @return a full pathname, or nil -- @return 'cannot create' error function app.appfile (file) local sname = path.basename(check_script_name()) local name,ext = path.splitext(sname) local dir = path.join(path.expanduser('~'),'.'..name) if not path.isdir(dir) then local ret = path.mkdir(dir) if not ret then return utils.raise ('cannot create '..dir) end end return path.join(dir,file) end --- return string indicating operating system. -- @return 'Windows','OSX' or whatever uname returns (e.g. 'Linux') function app.platform() if path.is_windows then return 'Windows' else local f = io.popen('uname') local res = f:read() if res == 'Darwin' then res = 'OSX' end f:close() return res end end --- return the full command-line used to invoke this script. -- Any extra flags occupy slots, so that `lua -lpl` gives us `{[-2]='lua',[-1]='-lpl'}` -- @return command-line -- @return name of Lua program used function app.lua () local args = _G.arg or error "not in a main program" local imin = 0 for i in pairs(args) do if i < imin then imin = i end end local cmd, append = {}, table.insert for i = imin,-1 do local a = args[i] if a:match '%s' then a = '"'..a..'"' end append(cmd,a) end return table.concat(cmd,' '),args[imin] end --- parse command-line arguments into flags and parameters. -- Understands GNU-style command-line flags; short (`-f`) and long (`--flag`). -- These may be given a value with either '=' or ':' (`-k:2`,`--alpha=3.2`,`-n2`); -- note that a number value can be given without a space. -- Multiple short args can be combined like so: ( `-abcd`). -- @tparam {string} args an array of strings (default is the global `arg`) -- @tab flags_with_values any flags that take values, e.g. `{out=true}` -- @return a table of flags (flag=value pairs) -- @return an array of parameters -- @raise if args is nil, then the global `args` must be available! function app.parse_args (args,flags_with_values) if not args then args = _G.arg if not args then error "Not in a main program: 'arg' not found" end end flags_with_values = flags_with_values or {} local _args = {} local flags = {} local i = 1 while i <= #args do local a = args[i] local v = a:match('^-(.+)') local is_long if v then -- we have a flag if v:find '^-' then is_long = true v = v:sub(2) end if flags_with_values[v] then if i == #_args or args[i+1]:find '^-' then return utils.raise ("no value for '"..v.."'") end flags[v] = args[i+1] i = i + 1 else -- a value can also be indicated with = local var,val = utils.splitv (v,'=') var = var or v val = val or true if not is_long then if #var > 1 then if var:find '.%d+' then -- short flag, number value val = var:sub(2) var = var:sub(1,1) else -- multiple short flags for i = 1,#var do flags[var:sub(i,i)] = true end val = nil -- prevents use of var as a flag below end else -- single short flag (can have value, defaults to true) val = val or true end end if val then flags[var] = val end end else _args[#_args+1] = a end i = i + 1 end return flags,_args end return app
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/npcs/flail/flailKiller.lua
1
4547
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. flailKiller = Creature:new { objectName = "flailKiller", -- Lua Object Name creatureType = "NPC", faction = "flail", factionPoints = 20, gender = "", speciesName = "flail_killer", stfName = "mob/creature_names", objectCRC = 1731610618, socialGroup = "flail", level = 18, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 4300, healthMin = 3500, strength = 0, constitution = 0, actionMax = 4300, actionMin = 3500, quickness = 0, stamina = 0, mindMax = 4300, mindMin = 3500, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 1, invincible = 0, attackCreatureOnSight = "corsec", -- Enter socialGroups weapon = "object/weapon/ranged/pistol/shared_pistol_fwg5.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "FWG5 Pistol", -- Name ex. 'a Vibrolance' weaponTemp = "pistol_fwg5", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "PistolRangedWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 1, weaponMinDamage = 180, weaponMaxDamage = 190, weaponAttackSpeed = 2, weaponDamageType = "ENERGY", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateweaponAttackSpeed = 2, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateweaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "flailAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(flailKiller, 1731610618) -- Add to Global Table
lgpl-3.0
OpenMusicKontrollers/chimaerad
app/httpd.lua
1
2875
--[[ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by * The Perl Foundation. * * This source is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Artistic License 2.0 for more details. * * You should have received a copy of the Artistic License 2.0 * along the source as a COPYING file. If not, obtain it from * http://www.perlfoundation.org/artistic_license_2_0. --]] local class = require('class') local rest_responder = require('rest_responder') local code = { [200] = 'HTTP/1.1 200 OK\r\n', [404] = 'HTTP/1.1 404 Not Found\r\n' } local content_type = { html = 'Content-Type: text/html\r\n\r\n', json = 'Content-Type: text/json\r\n\r\n', css = 'Content-Type: text/css\r\n\r\n', js = 'Content-Type: text/javascript\r\n\r\n', png = 'Content-Type: image/png\r\n\r\n' } setmetatable(content_type, { __index = function(self, key) return 'Content-Type: application/octet-stream\r\n\r\n' end}) local function httpd_cb(self, client, data) if(data.url == '/') then data.url = '/index.html' end -- first search for matching path in rest api if(self(data.url, client, data)) then return end local index = data.url:find('%.[^%.]*$') if(index) then local file = data.url:sub(2, index-1) local suffix = data.url:sub(index+1) local chunk = ZIP.read(file .. '.' .. suffix) if(chunk) then client(code[200] .. content_type[suffix] .. chunk) else client(code[404]) end else client(code[404]) end end local httpd = rest_responder:new({ port = 8080, push_client = function(self, client) table.insert(self.clients, client) self:_dispatch() end, broadcast_json = function(self, data) table.insert(self.queue, data) self:_dispatch() end, unicast_json = function(self, client, data) local err, str = JSON.encode(data) if(not err) then client(code[200] .. content_type['json'] .. str) else client(code[200] .. content_type['json'] .. JSON.encode({status='error', message='JSON encoding'})) end end, _dispatch = function(self) if(#self.queue>0 and #self.clients>0) then local item = table.remove(self.queue, 1) for _, client in ipairs(self.clients) do local err, str = JSON.encode(item) if(not err) then client(code[200] .. content_type['json'] .. str) else client(code[200] .. content_type['json'] .. JSON.encode({status='error', message='JSON encoding'})) end end self.clients = {} end end, _init = function(self) self.queue = {} self.clients = {} self.server = HTTP.new(self.port, function(client, data) httpd_cb(self, client, data) end) end }) return httpd
artistic-2.0
Modified-MW-DF/modified-MDF
MWDF Project/Dwarf Fortress/hack/scripts/teleport.lua
2
1803
-- teleports a unit to a location -- author Putnam -- edited by expwnent --[====[ teleport ======== Teleports a unit to given coordinates. Examples: :teleport -showunitid: prints ID of unit beneath cursor :teleport -showpos: prints coordinates beneath cursor :teleport -unit 1234 -x 56 -y 115 -z 26: teleports unit 1234 to 56,115,26 ]====] function teleport(unit,pos) local unitoccupancy = dfhack.maps.getTileBlock(unit.pos).occupancy[unit.pos.x%16][unit.pos.y%16] local newoccupancy = dfhack.maps.getTileBlock(pos).occupancy[pos.x%16][pos.y%16] if newoccupancy.unit then unit.flags1.on_ground=true end unit.pos.x = pos.x unit.pos.y = pos.y unit.pos.z = pos.z if not unit.flags1.on_ground then unitoccupancy.unit = false else unitoccupancy.unit_grounded = false end end utils = require('utils') validArgs = validArgs or utils.invert({ 'unit', 'x', 'y', 'z', 'showunitid', 'showpos' }) if moduleMode then return end local args = utils.processArgs({...}, validArgs) if args.showunitid or args.showpos then if args.showunitid then print(dfhack.gui.getSelectedUnit(true).id) else printall(df.global.cursor) end else local unit = tonumber(args.unit) and df.unit.find(tonumber(args.unit)) or dfhack.gui.getSelectedUnit(true) local pos = not(not args.x or not args.y or not args.z) and {x=args.x,y=args.y,z=args.z} or {x=df.global.cursor.x,y=df.global.cursor.y,z=df.global.cursor.z} if not unit then qerror('A unit needs to be selected or specified. Use teleport -showunitid to get a unit\'s ID.') end if not pos.x or pos.x==-30000 then qerror('A position needs to be highlighted or specified. Use teleport -showpos to get a position\'s exact xyz values.') end teleport(unit,pos) end
mit
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/weapons/weapon_zs_basemelee/shared.lua
1
9463
if SERVER then AddCSLuaFile("shared.lua") AddCSLuaFile("cl_init.lua") AddCSLuaFile("animations.lua") end SWEP.ViewModel = "models/weapons/v_axe/v_axe.mdl" SWEP.WorldModel = "models/weapons/w_axe.mdl" SWEP.Primary.ClipSize = -1 SWEP.Primary.DefaultClip = -1 SWEP.Primary.Automatic = true SWEP.Primary.Ammo = "none" SWEP.Primary.Delay = 1 SWEP.MeleeDamage = 30 SWEP.MeleeRange = 65 SWEP.MeleeSize = 1.5 SWEP.MeleeKnockBack = 0 SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = true SWEP.Secondary.Ammo = "none" SWEP.WalkSpeed = SPEED_FAST SWEP.IsMelee = true SWEP.HoldType = "melee" SWEP.SwingHoldType = "grenade" SWEP.DamageType = DMG_SLASH SWEP.BloodDecal = "Blood" SWEP.HitDecal = "Impact.Concrete" SWEP.HitAnim = ACT_VM_HITCENTER SWEP.MissAnim = ACT_VM_MISSCENTER SWEP.SwingTime = 0 SWEP.SwingRotation = Angle(0, 0, 0) SWEP.SwingOffset = Vector(0, 0, 0) function SWEP:Initialize() self:SetDeploySpeed(1.1) self:SetWeaponHoldType(self.HoldType) self:SetWeaponSwingHoldType(self.SwingHoldType) if CLIENT then self:Anim_Initialize() end end function SWEP:SetWeaponSwingHoldType(t) local old = self.ActivityTranslate self:SetWeaponHoldType(t) local new = self.ActivityTranslate self.ActivityTranslate = old self.ActivityTranslateSwing = new end function SWEP:Deploy() gamemode.Call("WeaponDeployed", self.Owner, self) self.IdleAnimation = CurTime() + self:SequenceDuration() return true end function SWEP:Think() if self.IdleAnimation and self.IdleAnimation <= CurTime() then self.IdleAnimation = nil self:SendWeaponAnim(ACT_VM_IDLE) end if self:IsSwinging() and self:GetSwingEnd() <= CurTime() then self:StopSwinging() self:MeleeSwing() end --[[if CLIENT then self:Anim_Think() end]] end function SWEP:SecondaryAttack() end function SWEP:Reload() return false end function SWEP:CanPrimaryAttack() if self.Owner:IsHolding() or self.Owner:GetBarricadeGhosting() then return false end return self:GetNextPrimaryFire() <= CurTime() and not self:IsSwinging() end function SWEP:PlaySwingSound() self:EmitSound("weapons/iceaxe/iceaxe_swing1.wav") end function SWEP:PlayStartSwingSound() end function SWEP:PlayHitSound() self:EmitSound("weapons/melee/golf club/golf_hit-0"..math.random(4)..".ogg") end function SWEP:PlayHitFleshSound() self:EmitSound("physics/body/body_medium_break"..math.random(2, 4)..".wav") end function SWEP:PrimaryAttack() if not self:CanPrimaryAttack() then return end self:SetNextPrimaryFire(CurTime() + self.Primary.Delay) if self.SwingTime == 0 then self:MeleeSwing() else self:StartSwinging() end end function SWEP:Holster() if CurTime() >= self:GetSwingEnd() then if CLIENT then self:Anim_Holster() end return true end return false end function SWEP:StartSwinging() if self.StartSwingAnimation then self:SendWeaponAnim(self.StartSwingAnimation) self.IdleAnimation = CurTime() + self:SequenceDuration() end self:PlayStartSwingSound() self:SetSwingEnd(CurTime() + self.SwingTime) end function SWEP:MeleeSwing() local owner = self.Owner owner:DoAttackEvent() local filter = owner:GetMeleeFilter() owner:LagCompensation(true) local tr = owner:MeleeTrace(self.MeleeRange, self.MeleeSize, filter) if tr.Hit then local damagemultiplier = owner.BuffMuscular and 1.2 or 1 local damage = self.MeleeDamage * damagemultiplier local hitent = tr.Entity local hitflesh = tr.MatType == MAT_FLESH or tr.MatType == MAT_BLOODYFLESH or tr.MatType == MAT_ANTLION or tr.MatType == MAT_ALIENFLESH if self.HitAnim then self:SendWeaponAnim(self.HitAnim) end self.IdleAnimation = CurTime() + self:SequenceDuration() if hitflesh then util.Decal(self.BloodDecal, tr.HitPos + tr.HitNormal, tr.HitPos - tr.HitNormal) self:PlayHitFleshSound() if SERVER and not (hitent:IsValid() and hitent:IsPlayer() and hitent:Team() == owner:Team()) then util.Blood(tr.HitPos, math.Rand(damage * 0.25, damage * 0.6), (tr.HitPos - owner:GetShootPos()):GetNormalized(), math.Rand(damage * 6, damage * 12), true) end if not self.NoHitSoundFlesh then self:PlayHitSound() end else util.Decal(self.HitDecal, tr.HitPos + tr.HitNormal, tr.HitPos - tr.HitNormal) self:PlayHitSound() end if self.OnMeleeHit and self:OnMeleeHit(hitent, hitflesh, tr) then --owner:LagCompensation(false) return end if SERVER and hitent:IsValid() then damage = self.MeleeDamage * damagemultiplier if hitent:GetClass() == "func_breakable_surf" then hitent:Fire("break", "", 0.01) -- Delayed because no way to do prediction. else local dmginfo = DamageInfo() dmginfo:SetDamagePosition(tr.HitPos) dmginfo:SetDamage(damage) dmginfo:SetAttacker(owner) dmginfo:SetInflictor(self) dmginfo:SetDamageType(self.DamageType) dmginfo:SetDamageForce(self.MeleeDamage * 20 * owner:GetAimVector()) if hitent:IsPlayer() then hitent:MeleeViewPunch(damage) if hitent:IsHeadcrab() then damage = damage * 2 dmginfo:SetDamage(damage) end gamemode.Call("ScalePlayerDamage", hitent, tr.HitGroup, dmginfo) if self.MeleeKnockBack > 0 then hitent:ThrowFromPositionSetZ(tr.HitPos, self.MeleeKnockBack, nil, true) end end if hitent:IsPlayer() then hitent:TakeDamageInfo(dmginfo) else -- Again, no way to do prediction. timer.Simple(0, function() if hitent:IsValid() then -- Workaround for propbroken not calling. local h = hitent:Health() hitent:TakeDamageInfo(dmginfo) if hitent:Health() <= 0 and h ~= hitent:Health() then gamemode.Call("PropBroken", hitent, owner) end local phys = hitent:GetPhysicsObject() if hitent:GetMoveType() == MOVETYPE_VPHYSICS and phys:IsValid() and phys:IsMoveable() then hitent:SetPhysicsAttacker(owner) end end end) end end end if self.PostOnMeleeHit then self:PostOnMeleeHit(hitent, hitflesh, tr) end else if self.MissAnim then self:SendWeaponAnim(self.MissAnim) end self.IdleAnimation = CurTime() + self:SequenceDuration() self:PlaySwingSound() if self.PostOnMeleeMiss then self:PostOnMeleeMiss(tr) end end local owner = self.Owner owner:ViewPunch(Angle(-1, 0, math.Rand(-1, 1))) --owner:LagCompensation(true) local mouthpos = owner:EyePos() + owner:GetUp() * -3 local screampos = mouthpos + owner:GetAimVector() * 16 for _, ent in pairs(ents.FindInSphere(screampos, 92)) do if ent:IsPlayer() and ent:Team() ~= owner:Team() then local entearpos = ent:EyePos() local dist = screampos:Distance(entearpos) if dist <= 92 and TrueVisible(entearpos, screampos) then local power = (92 / dist - 1) * 2 --(ent, power) for i=1, 5 do --timer.Simple(0.15 * i, function() viewpunch(ent, power - i * 0.125) end) end end end end owner:LagCompensation(false) end function SWEP:StopSwinging() self:SetSwingEnd(0) end function SWEP:IsSwinging() return self:GetSwingEnd() > 0 end function SWEP:SetSwingEnd(swingend) self:SetDTFloat(0, swingend) end function SWEP:GetSwingEnd() return self:GetDTFloat(0) end local ActIndex = { [ "pistol" ] = ACT_HL2MP_IDLE_PISTOL, [ "smg" ] = ACT_HL2MP_IDLE_SMG1, [ "grenade" ] = ACT_HL2MP_IDLE_GRENADE, [ "ar2" ] = ACT_HL2MP_IDLE_AR2, [ "shotgun" ] = ACT_HL2MP_IDLE_SHOTGUN, [ "rpg" ] = ACT_HL2MP_IDLE_RPG, [ "physgun" ] = ACT_HL2MP_IDLE_PHYSGUN, [ "crossbow" ] = ACT_HL2MP_IDLE_CROSSBOW, [ "melee" ] = ACT_HL2MP_IDLE_MELEE, [ "slam" ] = ACT_HL2MP_IDLE_SLAM, [ "normal" ] = ACT_HL2MP_IDLE, [ "fist" ] = ACT_HL2MP_IDLE_FIST, [ "melee2" ] = ACT_HL2MP_IDLE_MELEE2, [ "passive" ] = ACT_HL2MP_IDLE_PASSIVE, [ "knife" ] = ACT_HL2MP_IDLE_KNIFE, [ "duel" ] = ACT_HL2MP_IDLE_DUEL } function SWEP:SetWeaponHoldType( t ) t = string.lower( t ) local index = ActIndex[ t ] if ( index == nil ) then Msg( "SWEP:SetWeaponHoldType - ActIndex[ \""..t.."\" ] isn't set! (defaulting to normal)\n" ) t = "normal" index = ActIndex[ t ] end self.ActivityTranslate = {} self.ActivityTranslate [ ACT_MP_STAND_IDLE ] = index self.ActivityTranslate [ ACT_MP_WALK ] = index+1 self.ActivityTranslate [ ACT_MP_RUN ] = index+2 self.ActivityTranslate [ ACT_MP_CROUCH_IDLE ] = index+3 self.ActivityTranslate [ ACT_MP_CROUCHWALK ] = index+4 self.ActivityTranslate [ ACT_MP_ATTACK_STAND_PRIMARYFIRE ] = index+5 self.ActivityTranslate [ ACT_MP_ATTACK_CROUCH_PRIMARYFIRE ] = index+5 self.ActivityTranslate [ ACT_MP_RELOAD_STAND ] = index+6 self.ActivityTranslate [ ACT_MP_RELOAD_CROUCH ] = index+6 self.ActivityTranslate [ ACT_MP_JUMP ] = index+7 self.ActivityTranslate [ ACT_RANGE_ATTACK1 ] = index+8 self.ActivityTranslate [ ACT_MP_SWIM_IDLE ] = index+8 self.ActivityTranslate [ ACT_MP_SWIM ] = index+9 -- "normal" jump animation doesn't exist if t == "normal" then self.ActivityTranslate [ ACT_MP_JUMP ] = ACT_HL2MP_JUMP_SLAM end -- these two aren't defined in ACTs for whatever reason if t == "knife" || t == "melee2" then self.ActivityTranslate [ ACT_MP_CROUCH_IDLE ] = nil end end SWEP:SetWeaponHoldType("pistol") function SWEP:TranslateActivity( act ) if self:GetSwingEnd() ~= 0 and self.ActivityTranslateSwing[act] then return self.ActivityTranslateSwing[act] or -1 end return self.ActivityTranslate and self.ActivityTranslate[act] or -1 end
gpl-2.0
devilrap97/alirap97
plugins/ar-plugins.lua
13
7118
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ BY SAJAD NOORI (@SAJJADNOORI) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ plugins : تفعيل الملفات ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ --]] do -- Returns the key (index) in the config.enabled_plugins table local function plugin_enabled( name ) for k,v in pairs(_config.enabled_plugins) do if name == v then return k end end -- If not found return false end -- Returns true if file exists in plugins folder local function plugin_exists( name ) for k,v in pairs(plugins_names()) do if name..'.lua' == v then return true end end return false end local function list_all_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✔ enabled, ❌ disabled local status = '❌' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '✔' end nact = nact+1 end if not only_enabled or status == '✔' then -- get the name v = string.match (v, "(.*)%.lua") text = text..nsum..'. '..v..' '..status..'\n' end end local text = text..'\n الملفات المثبته 🔨. '..nsum..'\nالملفات المفعله ✔️ .'..nact..'\nغير مفعل 🚫 '..nsum-nact..'' return text end local function list_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✔ enabled, ❌ disabled local status = '❌' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '✔' end nact = nact+1 end if not only_enabled or status == '✔' then -- get the name v = string.match (v, "(.*)%.lua") text = text..v..' '..status..'\n' end end local text = text..'\n'..nact..' plugins enabled from '..nsum..' plugins installed.' return text end local function reload_plugins( ) plugins = {} load_plugins() return list_plugins(true) end local function enable_plugin( plugin_name ) print('checking if '..plugin_name..' exists') -- Check if plugin is enabled if plugin_enabled(plugin_name) then return 'اَلـَمِلفَ 📙 '..plugin_name..' مفـَعـلَِ 👍🏻 ✔️' end -- Checks if plugin exists if plugin_exists(plugin_name) then -- Add to the config table table.insert(_config.enabled_plugins, plugin_name) print(plugin_name..' added to _config table') save_config() -- Reload the plugins return reload_plugins( ) else return ''..plugin_name..' ✋🏿لآَ يـَوْجـدِ مـلفَ 📙 بأسـم ' end end local function disable_plugin( name, chat ) -- Check if plugins exists if not plugin_exists(name) then return ''..name..' ✋🏿لآَ يـَوْجـدِ مـلفَ 📙 بأسـم ' end local k = plugin_enabled(name) -- Check if plugin is enabled if not k then return 'اَلـَمِلفَ 📙 '..name..' غـيرَ مفـَعـلَِ 👍🏻 ❌' end -- Disable and reload table.remove(_config.enabled_plugins, k) save_config( ) return reload_plugins(true) end local function disable_plugin_on_chat(receiver, plugin) if not plugin_exists(plugin) then return "Plugin doesn't exists" end if not _config.disabled_plugin_on_chat then _config.disabled_plugin_on_chat = {} end if not _config.disabled_plugin_on_chat[receiver] then _config.disabled_plugin_on_chat[receiver] = {} end _config.disabled_plugin_on_chat[receiver][plugin] = true save_config() return 'Plugin '..plugin..' disabled on this chat' end local function reenable_plugin_on_chat(receiver, plugin) if not _config.disabled_plugin_on_chat then return 'There aren\'t any disabled plugins' end if not _config.disabled_plugin_on_chat[receiver] then return 'There aren\'t any disabled plugins for this chat' end if not _config.disabled_plugin_on_chat[receiver][plugin] then return 'This plugin is not disabled' end _config.disabled_plugin_on_chat[receiver][plugin] = false save_config() return 'Plugin '..plugin..' is enabled again' end local function run(msg, matches) -- Show the available plugins if matches[1] == 'الملفات' and is_sudo(msg) then --after changed to moderator mode, set only sudo return list_all_plugins() end -- Re-enable a plugin for this chat if matches[1] == 'تفعيل ملف' and matches[3] == 'chat' then local receiver = get_receiver(msg) local plugin = matches[2] print("enable "..plugin..' on this chat') return reenable_plugin_on_chat(receiver, plugin) end -- Enable a plugin if matches[1] == 'تفعيل ملف' and is_sudo(msg) then --after changed to moderator mode, set only sudo local plugin_name = matches[2] print("enable: "..matches[2]) return enable_plugin(plugin_name) end -- Disable a plugin on a chat if matches[1] == 'تعطيل ملف' and matches[3] == 'chat' then local plugin = matches[2] local receiver = get_receiver(msg) print("disable "..plugin..' on this chat') return disable_plugin_on_chat(receiver, plugin) end -- Disable a plugin if matches[1] == 'تعطيل ملف' and is_sudo(msg) then --after changed to moderator mode, set only sudo if matches[2] == 'plugins' then return 'This plugin can\'t be disabled' end print("disable: "..matches[2]) return disable_plugin(matches[2]) end -- Reload all the plugins! if matches[1] == 'الملفات المفعله' and is_sudo(msg) then --after changed to moderator mode, set only sudo return reload_plugins(true) end end return { description = "Plugin to manage other plugins. Enable, disable or reload.", usage = { moderator = { "!plugins disable [plugin] chat : disable plugin only this chat.", "!plugins enable [plugin] chat : enable plugin only this chat.", }, sudo = { "!plugins : list all plugins.", "!plugins enable [plugin] : enable plugin.", "!plugins disable [plugin] : disable plugin.", "!plugins reload : reloads all plugins." }, }, patterns = { "^الملفات$", "^(تفعيل ملف) ([%w_%.%-]+)$", "^(تعطيل ملف) ([%w_%.%-]+)$", "^(تفعيل ملف) ([%w_%.%-]+) (chat)", "^(تعطيل ملف) ([%w_%.%-]+) (chat)", "^(الملفات المفعله)$" }, run = run, moderated = true, -- set to moderator mode --privileged = true } end
gpl-2.0
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/entities/prop_ffemitter/init.lua
1
1714
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") ENT.m_Health = 150 function ENT:Initialize() self:SetModel("models/props_lab/lab_flourescentlight002b.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetUseType(SIMPLE_USE) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:EnableMotion(false) phys:Wake() end local ent = ents.Create("prop_ffemitterfield") if ent:IsValid() then self.Field = ent ent:SetPos(self:GetPos() + self:GetForward() * 48) ent:SetAngles(self:GetAngles()) ent:SetOwner(self) ent:Spawn() end end function ENT:OnRemove() if self.Field and self.Field:IsValid() then self.Field:Remove() end end function ENT:OnTakeDamage(dmginfo) self:TakePhysicsDamage(dmginfo) if not self.Destroyed then local attacker = dmginfo:GetAttacker() if not (attacker:IsValid() and attacker:IsPlayer() and attacker:Team() == TEAM_HUMAN) then if attacker.LifeBarricadeDamage ~= nil and self:HumanNearby() then attacker:AddLifeBarricadeDamage(dmginfo:GetDamage()) end self.m_Health = self.m_Health - dmginfo:GetDamage() if self.m_Health <= 0 then self.Destroyed = true local effectdata = EffectData() effectdata:SetOrigin(self:LocalToWorld(self:OBBCenter())) util.Effect("Explosion", effectdata, true, true) end end end end function ENT:AltUse(activator, tr) self:PackUp(activator) end function ENT:OnPackedUp(pl) pl:GiveEmptyWeapon("weapon_zs_ffemitter") pl:GiveAmmo(1, "slam") pl:PushPackedItem(self:GetClass(), self.m_Health) self:Remove() end function ENT:Think() if self.Destroyed then self:Remove() end end
gpl-2.0