Help with npc ranking

garro

New member
Messages
23
Points
0
Github
sran
Good evening, I have this pvp npc that I have modified, I take help since if I put a single map, the if I throw the option that says disbottom you have killed X in pvp, but if I put several maps I do not I can not help it with my error, thank you.
 

pvp2.txt

 

Attachments

Last edited by a moderator:
people of rAthena
wrong forum.
default_biggrin.png


 
Last edited by a moderator:
Yes, hahaha later I realized

 
Last edited by a moderator:
I do see your problem though:

if (.@mapa$ != "pvp_n_1-5,guild_vs2,pvp_n_1-3")

Here you are checking for a map called "pvp_n_1-5,guild_vs2,pvp_n_1-3", not for 3 different maps.

Try replacing by:

Code:
if (.@mapa$ != "pvp_n_1-5" && .@mapa$ != "guild_vs2" && .@mapa$ != "pvp_n_1-3")
 
The disbottom has killed so many, but not as I should enter the pvp room and not throw it, example I'm going to prontera, alberta and appears.

 
The issue is if you are duplicating an NPC (i.e. multiple NPCs running same script), every time OnPCKillEvent/DieEvent is triggered, it will activate for all NPCs. This script very messy, hard to read for me so don't know what's going on.

But something like this is an example. The following script would cause the script to run 5 times - 1 original and 4 duplicates.

-    script    Kill Announce    FAKE_NPC,{

OnPCKillEvent:
    announce("" + strcharinfo(PC_NAME) + " killed somebody.", bc_all);
    end;

}

prontera,150,150,3    duplicate(Kill Announce)    Kill Announce#1    FAKE_NPC
payon,150,150,3    duplicate(Kill Announce)    Kill Announce#2    FAKE_NPC
izlude,150,150,3    duplicate(Kill Announce)    Kill Announce#3    FAKE_NPC
alberta,150,150,3    duplicate(Kill Announce)    Kill Announce#4    FAKE_NPC


You can edit it like such so it would only announce when killed somebody on your same map.

-    script    Kill Announce#template    FAKE_NPC,{

OnPCKillEvent:
    if (strnpcinfo(NPC_NAME_HIDDEN) == "template")
        end;

    if (strnpcinfo(NPC_MAP) != strcharinfo(PC_MAP))
        end;
    
    announce("" + strcharinfo(PC_NAME) + " killed somebody.", bc_all);
    end;

}

prontera,150,150,3    duplicate(Kill Announce)    Kill Announce#1    FAKE_NPC
payon,150,150,3    duplicate(Kill Announce)    Kill Announce#2    FAKE_NPC
izlude,150,150,3    duplicate(Kill Announce)    Kill Announce#3    FAKE_NPC
alberta,150,150,3    duplicate(Kill Announce)    Kill Announce#4    FAKE_NPC

Idk if this is helpful ,just thought i would put it out there

 
Last edited by a moderator:
Thanks I had to change script better and I found this one that is better, but I am having a problem with the ranking, I kill someone in pvp_n_1-5 and it tells me the death in the ranking but I kill another in guild_vs2 and it does not tell me can you help me

Thanks I had to change script better and I found this one that is better, but I am having a problem with the ranking, I kill someone in pvp_n_1-5 and it tells me the death in the ranking but I kill another in guild_vs2 and it does not tell me can you help me

pvp2.txt

 

Attachments

Back
Top