SphereCommunity
Unique fight music in different regions? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Unique fight music in different regions? (/Thread-Unique-fight-music-in-different-regions)



Unique fight music in different regions? - Adohleas - 06-02-2013 08:01 PM

Im working on bringing my shard back up and I am wondering if on 56b you can set unique war music for each region?

My old script from an older sphere version doesnt work anymore when used on 56b:
Code:
ON=@ENTER
        IF (0<SRC.FLAGS>=<SRC.FLAGS>|statf_war)
        SRC.MUSIC=38
        ELSE
    SRC.music=20
ENDIF
ON=@CLIPERIODIC
        IF (0<SRC.FLAGS>=<SRC.FLAGS>|statf_war)
        SRC.MUSIC=38
        ELSE
    SRC.music=20
ENDIF

With my shard being a Final Fantasy style shard and having many dungeons and boss rooms, It really takes away from the immersion when your about to fight a boss and the music suddenly changes from the boss music to the default war music #.

Thanks in advance.


RE: Unique fight music in different regions? - RanXerox - 06-03-2013 04:08 AM

In an IF statement, you can think of the & symbol as the word "includes"... so

IF (<SRC.FLAGS> & statf_war)

...is probably what you are looking for.


RE: Unique fight music in different regions? - Mordaunt - 06-03-2013 04:47 AM

*Hastily deletes his early morning pre-coffee post*
lol


RE: Unique fight music in different regions? - Adohleas - 06-05-2013 04:52 PM

Created a work around since the above wasnt working due to the combat music taking over as long as your in war mode.
Code:
[events e_dattack]
ON=@UserWarmode
SRC.NEWITEM=i_attacking_t
SRC.ACT.ATTR=attr_decay
SRC.ACT.TIMER 15
SRC.ACT.P=<SRC.P>
UID.<SRC.ACT.UID>.USE
SRC.UPDATE
RETURN 1

ON=@Attack
sendpacket 072 d00
IF (<ISPLAYER>)
dattack_check
ENDIF

ON=@CharAttack
IF (<ISPLAYER>)
dattack_check
ENDIF

[Function dattack_check]
IF !(<FINDID.i_memory_dattack>)
newitem i_memory_dattack
ACT.P=<P>
act.equip=<UID>
ACT.TIMER 15
ELSE
FINDID.i_memory_dattack.timer 15
ENDIF

[ITEMDEF i_memory_dattack]
NAME=attack memory
ID=i_memory
TYPE=t_eq_script

ON=@Create
TIMER=15

ON=@Timer
IF (<CONT.FLAGS> & statf_war)
CONT.FLAGS = <CONT.FLAGS> &~statf_war
REMOVE
ENDIF
RETURN 1

[ITEMDEF i_attacking_t]
NAME="Attack"
ID=i_memory
TYPE=t_eq_script

ON=@Dclick
TARGET Select a target to attack.
RETURN 1

ON=@Targon_Item
TARGET
RETURN 1

ON=@Targon_Char
SRC.ATTACK <SRC.TARG.UID>
REMOVE
RETURN 1

This isnt perfect, you wont be able to see your character in war mode(you will see yourself and the enemies attacking) and you will instead be forced to target who you wish to attack, but this prevents war mode which seems to ignore any music change through either the music command or sendpacket 06D.