Jump to content

Winterfox

Members
  • Content Count

    403
  • Joined

  • Last visited

  • Days Won

    10

Reputation Activity

  1. Upvote
    Winterfox got a reaction from mrlongshen in MVP Card annoucement   
    @@mrlongshen I named a variable wrong, thats why it didn't get executed. Also the cards will go directly into the inventory since the card drop is disabled by script and given to the player by the rate you can configure in the script.
    Check it out here: http://upaste.me/36f421015cab9f3e5
     
    Also i am no sir. :/
  2. Upvote
    Winterfox got a reaction from glemor123 in Zombie Event Problem   
    @@glemor123
    Depends on where you placed it. If it is in OnPCDieEvent: to make sure the event ends if noone is on the map because of logging out, than its allright.
    Like here: http://pastebin.com/nMaAEETK
  3. Upvote
    Winterfox got a reaction from glemor123 in Zombie Event Problem   
    I recommend to make it more readable and fix some quirks first.
     
    Some things i see:
    1. Prize is disabled twice in OnInit.
    2. Call killmonsterall is called several times in succession even though one time is enough per condition.
    3. atcommand("@alive"); doesn't need the username, since it's called like the player typed it by himself with gm level 99 and @alive by default revives the user that typed the command if no name is provided.
    4. You can change:
    if (BaseLevel > 1) goto NO;if (class == 0) goto event;if (class > 0) goto NO;event: to
    if (BaseLevel > 1) goto NO; that actually means: IF baselevel > 1 > 0 GOTO NO. You dont need another label for your event since if either conditions are true the interpreter jumps to NO and never runs the stuff after the if. Also a base level > 1 char doesn't posses a class you need to check for.
    5. You can change:
    if (sex == 1) {announce "In ' Zombie Vs. Novice ' has won" + strcharinfo (0) + "! We congratulate him!",0;}else {announce "In ' Zombie Vs. Novice ' has won" + strcharinfo (0) + "! We congratulate her!",0;}; to
    announce "In ' Zombie Vs. Novice ' has won" + strcharinfo (0) + "! We congratulate " + ((Sex) ? "him" : "her") + "!",0; .6. Since you have a npctimer anyway, you could use it for your announcement timing instead of sleep.
    7. You can change:
    OnTimer5000:if ( getmapusers("quiz_01") == 0 ){killmonsterall "quiz_01";announce "'Zombie Vs. Novice' has ended with Event, as all have died",0;disablenpc "Prize";stopnpctimer;end;}else if ( getmapusers("quiz_01") > 1 ){mapannounce "quiz_01",getmapusers("quiz_01") +"the player still survive on Event.",0,0x00FF00;;initnpctimer;end;}initnpctimer;end; to
    OnTimer5000: if ( getmapusers("quiz_01") == 0 ) { killmonsterall "quiz_01"; announce "'Zombie Vs. Novice' has ended with Event, as all have died",0; disablenpc "Prize"; stopnpctimer; end; } if ( getmapusers("quiz_01") > 1 ) mapannounce "quiz_01",getmapusers("quiz_01") +"the player still survive on Event.",0,0x00FF00; initnpctimer;end; 8. The killmonsterall at the event start is redudant since either they get killed by your checks anyway.
    9. You can change
    OnPCDieEvent:getmapxy .@mapnvz$,.@xnvz,.@ynvz,0;if ( .@mapnvz$ == "quiz_01") {sleep2 1;warp "prontera",154,95;atcommand "@alive "+ strcharinfo(0);dispbottom "you have lost...";}sleep2 1000;if(getmapusers("quiz_01") == 1){killmonsterall "quiz_01";mapannounce "quiz_01","You have won, approach please to npc Prize.",0;killmonsterall "quiz_01";killmonsterall "quiz_01";killmonsterall "quiz_01";killmonsterall "quiz_01";enablenpc "Prize";killmonsterall "quiz_01";stopnpctimer;end;}if(getmapusers("quiz_01") == 0){killmonsterall "quiz_01";killmonsterall "quiz_01";killmonsterall "quiz_01";killmonsterall "quiz_01";stopnpctimer;end;}end;} to:
    OnPCDieEvent: if ( strcharinfo(PC_MAP) == "quiz_01") { warp("prontera",154,95); atcommand("@alive"); dispbottom("you have lost..."); } if(getmapusers("quiz_01") == 1){ killmonsterall("quiz_01"); announce("You have won, approach please to npc Prize.", bc_map); enablenpc("Prize"); stopnpctimer; }end; 10. The var sex has to be named Sex, it won't break your script but drop a error message on the server.
    I gave it a shot and tried to clean it, let me know how it works out: http://pastebin.com/HNnpL42L
  4. Upvote
    Winterfox got a reaction from mrlongshen in Restrict gm below 60   
    I dont know if that works, but maybe you can disable it via groups.conf for GMs below 60 and use that script:
    - script mobspawn_restriction -1,{ OnInit: bindatcmd("monster", strnpcinfo(3) + "::OnAtcommand"); .maxMobsPerSpawn = 5; end; OnAtcommand: if(getgmlevel() >= 60 || getgmlevel() == 0) end; .@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]); if(.@mobCount > .maxMobsPerSpawn) { dispbottom("You can't spawn more than " + .@mobCount + " mobs at a time."); end; } atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount); end;} I don't know if this doesn't fail when the @monster command is restricted but how it should work is, it blocks the original monster command, hooks it and starts the atcommand via script and restricts the monster spawn. If a user with a gm level below 1 or above 60 uses @monster, the script just ends itself instead of doing anything since users below gm level 1 shouldn't be able to use it and users above 60 aren't restricted so the original should work.
     
    If that approach fails or you don't mind having a second monster command you also could use this:
    - script mobspawn_restriction -1,{ OnInit: bindatcmd("monster2", strnpcinfo(3) + "::OnAtcommand"); .maxMobsPerSpawn = 5; end; OnAtcommand: if(getgmlevel() == 0) end; .@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]); if(.@mobCount > .maxMobsPerSpawn) { dispbottom("You can't spawn more than " + .@mobCount + " mobs at a time."); end; } atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount); end;} Can be used like @monster you just have to use @monster2 it ignores everything below gm level 1. If used by any gm it works like a restricted @monster. All you have to do is to restrict the original @monster command for gms below 60 in the groups.conf.
  5. Upvote
    Winterfox got a reaction from mrlongshen in R > PVP & MVP Cash point on killed   
    @@mrlongshen Didn't you see my last post? In http://pastebin.com/BU4kry6p this error shouldn't be there.
  6. Upvote
    Winterfox got a reaction from mrlongshen in R > PVP & MVP Cash point on killed   
    http://pastebin.com/j2LfhEwV
     
    You have to change the .@mobIds array to the ids of the mobs you want to give rewards for, in your case the MVPs. I am sorry for this inconvinience but i couldn't find a solution that can tell if a certain mob id is a mvp. :/
     
    To adjust the amounts of cash points the player gets you can use .mobRewardPoints and pvpRewardPoints, just change it to your needs.
     
    The MVP one will announce it on all maps, the pvp on only on the according map.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.