;-----------------Artifact PLM Event Based v1.2------------------------ ;------------------------OmegaDragnet9--------------------------------- ;Low Byte sets Event to be set by each PLM ;When a predefined series of events are set, the final message box will be displayed ;and an earthquake will take place in the room. ;This is largely thanks to JAM's Messenger PLM and P.JBoy's Banklogs. ;Thanks also to MetroidNerd#9001's earthquake script. ;Event setting script learned from dewhi100's resources. lorom ;---------------------Defines--------------------------------------- ;Messages ;Look in the SMART Message Box Editor to get the exact messages you want displayed. !Message1 = #$0020 ;Message displays every time !Message2 = #$002A ;Final Message to be displayed ;Events ;You can add as many of these as you want. ;Each PLM triggers an event, this serves as a Vanilla counter. ;When this series of events is set, it allows the final message to be displayed, ;And triggers an earthquake. !Event1 = #$0017 ;Events that must be satisfied to trigger the Final Event. !Event2 = #$0018 !Event3 = #$0019 !FinalEvent = #$0016 ;Event that you collect all the artifacts to trigger. !89Free = $899100 ;Freespace for Graphics ;--------------------GFX------------------------------------------- org !89Free ;incbin C:\CustomPLMGrafx.bin incbin C:\PROJECTY\Graphics\CustomPLMGrafx.bin ;-------------------PLM Header------------------------------------- org $84FC90 ;PLM Location DW $EE64 ;Pre-instruction, vanilla routine DW InstructionList ;-------------------PLM Instructions------------------------------- InstructionList: dw $8764,$9100 DB $01,$01,$01,$01,$01,$01,$01,$01 ;Load Item GFX DW $887C,.ArgumentSet ;Go to ".ArgumentSet" if the room argument item is set DW $8A24,.LinkInstruction ;Link Instruction to ".LinkInstruction" DW $86C1,$DF89 ;Pre-instruction = go to Link Instruction if Triggered .Loop DW $E04F ;Draw Item Frame 1 DW $E067 ;Draw Item Frame 2 DW $8724,.Loop .LinkInstruction DW $86CA DW $8899 ;Set the Room Argument, (PLM does not reappear in room) DW $8BDD ;Clear music queue and queue item fanfare music track DB $02 DW .MusicRestore DW .TheMagicHappen ;Goes to ".TheMagicHappen." This is where the Event is set and Message is selected. .ArgumentSet ;Go here if room argument item is set DW $8724,$DFA9 ;Go to instruction list Empty Item .TheMagicHappen PHX ;Low Byte sets event LDA $1DC7,x PLX AND #$00FF JSL $8081FA LDA !Message1 ;Display Message, this appears every time. JSL $858080 ;Event Checks, collect all and it displays one last message and an earthquake. LDA !Event1 ;Event Check 1 JSL $808233 BCC + LDA !Event2 ;Event Check 2 JSL $808233 BCC + LDA !Event3 ;Event Check 3 JSL $808233 BCC + ;Final Message, Final Event, Cinematic Earthquake. LDA !Message2 ;Final Message JSL $858080 LDA !FinalEvent ;Final Event after all the others are satisfied JSL $8081FA LDA #$0006 ;MetroidNerd#9001 Earthquake STA $183E LDA #$0046 STA $1840 LDA #$0046 JSL $8090CB + RTS .MusicRestore LDA #$0168 JSL $82E118 RTS