Jump to content
  • 0
Relman

DOTA PVP WITH REWARD

Question

Bonjour, J'ai un script que vous connaissez avec des sounds qui se jouent en PVP en rapport avec le nombres de kill ( Double kill, Triple kill, etc... )
Ce que je veux, c'est installer un système de reward par palier exemple :

Double kill = 5 Elunium

Triple kill = 5 Oridecon

Etc.....

 

Voila mon Script :

 

Quote

-    script    DOTAPVP    -1,{
OnInit:
// Config
    set .sound, 1; // soundeffect : 0 - disable, 1 - play soundeffect to all players on map, 2 - play soundeffect to an area around the killer, 3 - play soundeffect to killer only
    set .ownage, 2; // ownage announcement : 0 - disable, 1 - party owns, 2 - guild owns
    set .announce, 1; // make announce to : 0 - global, 1 - map
    set .announcemap, 0; // announce the map name in the announcement ? : 0 - off, 1 - on

    set .announcekill, 1; // announce who pawn who's head : 0 - off, 1- on
    set .msg_die, 0; // show message who kill you when die : 0 - off, 1- on
    set .msg_kill, 0; // show message you kill who when killed someone : 0 - off, 1- on

    set .gmnokill, 0; // GMs are not suppose to kill players. A GM with <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off
    set .doublekill, 2;
    set .triplekill, 3;
    set .killingspree, 4;
    set .dominating, 5;
    set .megakill, 6;
    set .unstoppable, 7;
    set .wickedsick, 8;
    set .monsterkill, 9;
    set .godlike, 10;
    set .holyshit, 11;
    set .continue, 1; // after beyond-godlike, every <this number> kills will make announcement again

    set .owned, 5; // how many times the party/guild has to kill to announce ownage
    set .owncontinue, 1; // after ownage, every <this number> party/guild cumulative kills will make ownage announce again

    setarray .maptrigger$, // only these maps will trigger this script
        "all", // comment this line to only trigger this script on these listed maps
        "guild_vs1",
        "guild_vs2",
        "guild_vs3",
        "guild_vs4",
        "guild_vs5";

    // anti-sit-killer system
    // a player must kill another player with this minimum <this number> level to get the announcement and in the ladder.
    // Otherwise only have streak ended announcement and killed player's streak reset.
    // Its possible for a level 1 novice to kill a level 55 player and he/she will still get in the ladder
    // but a level 55 kill a level 1 player will get nothing
    // 0 - off this system ( default is 55, pk setting )
    set .lvltokill, 0;

    // when a player kill another same player <this number> times in a row, the player is warp back to save point.
    // and the player's streak and ownage count will deduct accordingly
    // 0 - off this system
    set .counttopunish, 6;

    // minimum level range to kill another player
    // eg. when set to 20, player level 99 needs to kill another player with minimum level of 79 to get announcement and increase the kill rank.
    // but a player with base level 50 kills a level 99 will also get the announcement
    // higher base level cannot kill lower level, but lower level can kill higher level
    // 0 - off this system
    set .minlvlrange, 10;

// Config ends ------------------------------------------------------------------------------------------

//    to prevent bug happen
    if ( .ownage < 0 || .ownage > 2 ) set .ownage, 0;
    if ( .announce < 0 || .announce > 1 ) set .announce,0;
    if ( .continue < 1 ) set .continue, 1;
    if ( .owncontinue < 1 ) set .owncontinue, 1;
    if ( .gmnokill <= 0 ) set .gmnokill, 100;
    if ( .lvltokill <= 1 ) set .lvltokill, 0;
    if ( .counttopunish <= 1 ) set .counttopunish, 0;
    set .maptriggersize, getarraysize(.maptrigger$);
    end;

//    script start
OnPCKillEvent:
    if ( getgmlevel() >= .gmnokill ) end;
    getmapxy .@map$, .@x, .@y, 0;
    if ( .maptrigger$ != "all" ) {
        for ( set .@i, 0; .@i < .maptriggersize; set .@i, .@i +1 ) {
            if ( .@map$ == .maptrigger$[.@i] ) break;
        }
        if ( .@i == .maptriggersize ) end;
    }
    attachrid killedrid;
        if ( killerrid != getcharid(3) && ( .msg_die || .msg_kill ) ) {
            if ( .msg_die ) message strcharinfo(0),"You have been killed by "+ rid2name(killerrid);
            if ( .msg_kill ) message rid2name(killerrid),"You just killed "+ strcharinfo(0);
        }
        if ( @PlayersKilledStreak >= .holyshit )
            set .@streakname$,"Beyond Godlike";
        else if ( @PlayersKilledStreak >= .godlike )
            set .@streakname$,"Godlike";
        else if ( @PlayersKilledStreak >= .monsterkill )
            set .@streakname$,"Monster Kill";
        else if ( @PlayersKilledStreak >= .wickedsick )
            set .@streakname$,"Wicked Sick";
        else if ( @PlayersKilledStreak >= .unstoppable )
            set .@streakname$,"Unstoppable";
        else if ( @PlayersKilledStreak >= .megakill )
            set .@streakname$,"Mega-kill";
        else if ( @PlayersKilledStreak >= .dominating )
            set .@streakname$,"Dominating";
        else if ( @PlayersKilledStreak >= .killingspree )
            set .@streakname$,"Killing Spree";
        else if ( @PlayersKilledStreak >= .doublekill )
            set .@streakname$,"Double Kill";
        else if ( @PlayersKilledStreak >= .triplekill )
            set .@streakname$,"Triple Kill";


    if ( @PlayersKilledStreak >= .killingspree && killerrid == getcharid(3) )
        announce strcharinfo(0) +" A fini "+( (Sex)?"him":"her" )+" own "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
    else if ( @PlayersKilledStreak >= .killingspree )
        announce rid2name(killerrid) +" A fini "+ strcharinfo(0) +"'s "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
    else if ( .announcekill && killerrid != getcharid(3) )
        announce rid2name(killerrid) +" à eu la tête de "+ strcharinfo(0) +" "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
    set @PlayersKilledStreak,0;
    set @dota_multikills,0;
    if ( .ownage && getcharid(.ownage) ) {
        setd ".dotaown_"+ getcharid(.ownage), 0;
        set .@killedgroup, getcharid(.ownage);
    }
    if ( killerrid == getcharid(3) || BaseLevel < .lvltokill ) end;
    if ( .minlvlrange ) set .@killedlvl, BaseLevel;
    attachrid killerrid;
    if ( .minlvlrange && .@killedlvl + .minlvlrange < BaseLevel ) end;
    if ( .counttopunish ) {
        if ( @sitkillminute != gettime(2) ) {
            deletearray @sitkillid, 128;
            deletearray @sitkilltimes, 128;
            set @sitkillminute, gettime(2);
        }
        set .@sitkillsize, getarraysize(@sitkillid);
        for ( set .@i,0; .@i < .@sitkillsize; set .@i, .@i +1 ) {
            if ( @sitkillid[.@i] != killedrid ) continue;
            else {
                set @sitkilltimes[.@i], @sitkilltimes[.@i] +1 ;
                if ( @sitkilltimes[.@i] >= .counttopunish ) {
                    warp "SavePoint",0,0;
                    announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!",0;
                    debugmes strcharinfo(0) +" is sit-killing "+ rid2name(killedrid) +" for "+ @sitkilltimes[.@i] + " times";
                    logmes "is sit-killing "+ rid2name(killedrid) +" for "+ @sitkilltimes[.@i] +" times";
                    set @PlayersKilledStreak, @PlayersKilledStreak +1 - .counttopunish;
                    set PlayersKilled, PlayersKilled +1 - .counttopunish;
                    if ( .ownage && getcharid(.ownage) )
                        setd ".dotaown_"+ getcharid(.ownage), getd(".dotaown_"+ getcharid(.ownage) ) +1 - .counttopunish;
                    end;
                }
                break;
            }
        }
        if ( .@i == .@sitkillsize ) {
            set @sitkillid[.@i], killedrid;
            set @sitkilltimes[.@i], 1;
        }
    }
    set @PlayersKilledStreak, @PlayersKilledStreak + 1;
    set PlayersKilled, PlayersKilled + 1;
        if ( @PlayersKilledStreak == .killingspree )
            setarray .@streakname$,"killingspree.wav","is on a KILLING SPREE","!";
        else if ( @PlayersKilledStreak == .dominating )
            setarray .@streakname$,"dominating.wav","is DOMINATING","!";
else if ( @PlayersKilledStreak == .doublekill )
            setarray .@streakname$,"doublekill.wav","Réalise un Double Kill","!";
else if ( @PlayersKilledStreak == .triplekill )
            setarray .@streakname$,"triplekill.wav","Réalise un Triple Kill","!";
        else if ( @PlayersKilledStreak == .megakill )
            setarray .@streakname$,"humiliation.wav","à fait un MEGA KILL","!";
        else if ( @PlayersKilledStreak == .unstoppable )
            setarray .@streakname$,"unstoppable.wav","est UNSTOPPABLE","!!";
        else if ( @PlayersKilledStreak == .wickedsick )
            setarray .@streakname$,"wickedsick.wav","réalise un WICKED SICK","!!";
        else if ( @PlayersKilledStreak == .monsterkill )
            setarray .@streakname$,"monsterkill.wav","à fait un MONSTER KILL","!!";
        else if ( @PlayersKilledStreak == .godlike )
            setarray .@streakname$,"godlike.wav","is GODLIKE","!!!";
        else if ( @PlayersKilledStreak >= .holyshit && ( (@PlayersKilledStreak - .holyshit) % .continue == 0 ) )
            setarray .@streakname$,"godlike2.wav","Réalise un FUCKING GODLIKE",". Quelqu'un pour "+( (Sex)?"LE":"LA" ) +" TUER !!!!!!!";
    if ( .@streakname$[1] != "" ) {
        announce strcharinfo(0) +" "+ .@streakname$[1] +"["+ @PlayersKilledStreak +"] "+( (.announcemap)?("at "+ .@map$):"") + .@streakname$[2],16|.announce;
        if ( .sound == 1 ) soundeffectall .@streakname$[0],0,.@map$;
        else if ( .sound == 2 ) soundeffectall .@streakname$[0],0;
        else if ( .sound == 3 ) soundeffect .@streakname$[0],0;
    }
    set @dota_multikills, @dota_multikills + 1;
    deltimer "DOTAPVP::OnStreakReset";
    addtimer 18000,"DOTAPVP::OnStreakReset";
    if ( .ownage ) {
        set .@sideid, getcharid(.ownage);
        if ( .@sideid != .@killedgroup ) setd ".dotaown_"+ .@sideid, getd(".dotaown_"+ .@sideid ) + 1;
    }
    set .@dota_multikills, @dota_multikills;
    set .@origin, getcharid(3);
    sleep 1500;
    if ( .@sideid && .ownage && .@sideid != .@killedgroup && getd(".dotaown_"+ .@sideid) >= .owned && ( ( getd(".dotaown_"+ .@sideid) - .owned ) % .owncontinue == 0 ) )
    sleep 1250;
    if ( !attachrid(.@origin) ) end;
        OnWhisperGlobal:
    dispbottom "Votre séquence actuelle: "+ @PlayersKilledStreak;
    dispbottom "Vos Kills totaux          : "+ PlayersKilled;
    if ( .ownage && getcharid(.ownage) )
        dispbottom "Kills "+( (.ownage ==1)?"party":"guild" )+" Mort        : "+ getd(".dotaown_"+ getcharid(.ownage) );
    end;
OnStreakReset:
    set @dota_multikills, 0;
    end;
}

 

J'ai essayé en Rajoutant  : getitem 985,5; ici :

mais ca ne me fais carrément plus marcher le script.

une idée ?

Quote

else if ( @PlayersKilledStreak == .doublekill )
            setarray .@streakname$,"doublekill.wav","Réalise un Double Kill","!";

getitem 985,5;
else if ( @PlayersKilledStreak == .triplekill )

 

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi! on things like

On 7/13/2017 at 0:37 PM, Relman said:

else if ( @PlayersKilledStreak == .doublekill )
            setarray .@streakname$,"doublekill.wav","Réalise un Double Kill","!";

getitem 985,5;

put the getitem and the setarray inside a block using {  }

Eg. 

else if ( @PlayersKilledStreak == .doublekill ) {
	setarray .@streakname$,"doublekill.wav","Réalise un Double Kill","!";
	getitem <itemid>,<amount>;
}

 

 

Edited by Happy

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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