Notorius Posted May 24, 2023 Posted May 24, 2023 Hi, Rathena, I have a question. I want to make an mvp of an item drop randomly when you kill it in endless tower on the 80th floor. I'm trying to add a script but I don't know how to make it work. This is the script I want to add. endless: case 80: areamonster .@map$,352,351,362,387,"Blue Ifrit Shadow",31000,1,.@label$; break; my script: - script ifrit -1,{ OnNPCKillEvent: if ( killedrid != 31000 ) end; if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } end; } Quote
0 pajodex Posted May 26, 2023 Posted May 26, 2023 It seems like you are using a custom Endless tower. Just as example, I will use the official endless tower script. 1@tower,29,365,1 script #1F Controller 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 1, instance_mapname("1@tower"), instance_npcname("#1F Controller")+"::OnMyMobDead"; // This is the function calling the death event of the monster.. end; OnMyMobDead: // This one should trigger. set .@map$, instance_mapname("1@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("#1F Controller")+"::OnMyMobDead"); /* *************************************************** This is where you can add your script posted above I modified it abit so it wont stop the script from functioning. *************************************************** */ if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 1 } else mapannounce .@map$, "Remaining Monsters on the 1st Level - "+.@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("1@tower"), "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00"; donpcevent instance_npcname("1FGate102tower")+"::OnEnable"; stopnpctimer; end; } Quote
0 pajodex Posted May 24, 2023 Posted May 24, 2023 add the script on the label itself on endless tower script otherwise it wont be called Quote
0 Notorius Posted May 26, 2023 Author Posted May 26, 2023 On 5/24/2023 at 9:44 AM, pajodex said: add the script on the label itself on endless tower script otherwise it wont be called could you give me an example? Quote
0 Notorius Posted May 26, 2023 Author Posted May 26, 2023 17 minutes ago, pajodex said: It seems like you are using a custom Endless tower. Just as example, I will use the official endless tower script. 1@tower,29,365,1 script #1F Controller 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 1, instance_mapname("1@tower"), instance_npcname("#1F Controller")+"::OnMyMobDead"; // This is the function calling the death event of the monster.. end; OnMyMobDead: // This one should trigger. set .@map$, instance_mapname("1@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("#1F Controller")+"::OnMyMobDead"); /* *************************************************** This is where you can add your script posted above I modified it abit so it wont stop the script from functioning. *************************************************** */ if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 1 } else mapannounce .@map$, "Remaining Monsters on the 1st Level - "+.@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("1@tower"), "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00"; donpcevent instance_npcname("1FGate102tower")+"::OnEnable"; stopnpctimer; end; } 108 / 5,000 Resultados de traducción Traducción star_border I must add it there or at the level that I need it an example as I tried to do it before and it didn't work either 4@tower,29,365,2 script Immortal Furnace#3 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 76, instance_mapname("4@tower"), instance_npcname("Immortal Furnace#3")+"::OnMyMobDead"; end; OnMyMobDead: set .@map$, instance_mapname("4@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("Immortal Furnace#3")+"::OnMyMobDead"); if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 76 } else mapannounce .@map$,"Monstruos restantes en el nivel 76 - " + .@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("4@tower"),"Todos los monstruos del nivel 76 han sido derrotados.",bc_map,"0xffff00"; donpcevent instance_npcname("76FGate102tower")+"::OnEnable"; stopnpctimer; end; } Quote
Question
Notorius
Hi, Rathena, I have a question. I want to make an mvp of an item drop randomly when you kill it in endless tower on the 80th floor. I'm trying to add a script but I don't know how to make it work. This is the script I want to add.
endless:
my script:
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.