Jump to content

Ajjwidjdneidjenw

Members
  • Posts

    161
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Ajjwidjdneidjenw

  1. - script job_pvp -1,{
    OnInit:
    // only 1 config lol
    set .gmnokill, 10; // 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
    if ( .gmnokill <= 0 ) set .gmnokill, 101; // prevent bug
    end;
    OnPCKillEvent:
    if ( strcharinfo(3) != "guild_vs3" || (Class > 4000 && Class < 4023) || BaseLevel < 90) end;
    else if ( getgmlevel() >= .gmnokill ) end;
       query_sql "insert delayed into pvp_record values ( now() , "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ getcharid(0, rid2name(killedrid) ) +", '"+ escape_sql(rid2name(killedrid)) +"' )";
    if ( $pvprank_lastsaved$ != gettimestr("%Y_%m",15) ) {
     query_sql "insert delayed into pvpladder_archive select now(), name, kills, deaths, class from pvpladder order by kills desc limit 10";
     query_sql "delete from pvpladder";
     set $pvprank_lastsaved$, gettimestr("%Y_%m",15);
     donpcevent "PvP Ladder::OnInit";
    }
    attachrid killedrid;
    if ( pvprank_lastsaved$ != $pvprank_lastsaved$ ) {
     set pvprank_lastsaved$, $pvprank_lastsaved$;
     set @pvpl_deaths, 0;
     set @pvpl_kills, 0;
    }
    set @pvpl_deaths, @pvpl_deaths +1;
    query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )";
    if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count
    attachrid killerrid;
    if ( pvprank_lastsaved$ != $pvprank_lastsaved$ ) {
     set pvprank_lastsaved$, $pvprank_lastsaved$;
     set @pvpl_deaths, 0;
     set @pvpl_kills, 0;
    }
    set @pvpl_kills, @pvpl_kills +1;
    query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )";
    donpcevent "PvP Ladder::OnInit";
    end;
    OnPCLoadMapEvent:
    if ( strcharinfo(3) != "guild_vs3" || @pvpl_kills || @pvpl_deaths ) end;
    query_sql "select kills, deaths from pvpladder where char_id = "+ getcharid(0), @pvpl_kills, @pvpl_deaths;
    end;
    }
    
    

    • Upvote 1
  2. I wonder why it was never possible to give a parameter for getgmlevel

    BUILDIN_FUNC(getgmlevel)
    {
    TBL_PC* sd;
       if( script_getnum(st,2) )
        sd = script_getnum(st,2);
       else
        sd = script_rid2sd(st);
    if( sd == NULL )
    	return 0;// no player attached, report source
    
    script_pushint(st, pc_get_group_level(sd));
    
    return 0;
    }
    

    Untested (+I'm not that great @src but I can't test it right now).

  3. Eurphy, your WoE script rewarding system can be kind of exploided, if the players of the winning team open as many accounts as possible, I made a little change in it and maybe you could offer it to the other server owners as well.

    This is Mac based(harmony Required, and it could probably be a bit more clean, but I was kind of in a rush when I wrote it)

    	   	 query_sql ("SELECT guild_member.account_id, guild_member.char_id, login.last_mac FROM `guild_member`, `login` WHERE guild_id = '"+.@guild+"' AND guild_member.account_id = login.account_id", .@acc, .@char, .@mac$);
    			for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1)
    				if (!(getd(".@mc" + .@mac$[.@j])) && isloggedin(.@acc[.@j],.@char[.@j])) {
    					for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2)
    						getitem .Reward[.@k], .Reward[.@k+1], .@acc[.@j];
    					setd (".@mc" + .@mac$[.@j]),1;
    					message rid2name(.@acc[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+"."; } } }
    return;
    
    

  4. there's no player Attached so strcharinfo(0) obviously doesn't work :P. please show us more of the code so we can help you.

    edit:

    change

    // Respawn the Emperium, and display new owners.
    sleep 500; // Slow down script execution slightly.
    if( agitcheck() )
    	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
    sleep 7000;
    
    announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + strcharinfo(0) + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;
    
    end;
    

    to

    // Respawn the Emperium, and display new owners.
    sleep2 500; // Slow down script execution slightly.
    if( agitcheck() )
    	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
    sleep2 7000;
    
    announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + strcharinfo(0) + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;
    
    end;
    

    The players RID detaches because of the Sleep command, sleep2 does not detach the RID. However, if the player warps out before the announcement is made the rid also detaches so you could do the following instead.

    .@p$ = strcharinfo(0);
    // Respawn the Emperium, and display new owners.
    sleep 500; // Slow down script execution slightly.
    if( agitcheck() )
    	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
    sleep 7000;
    
    announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + .@p$ + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;
    
    end;
    

  5. It really depends on how you feel, you'll have to redesign some of the skills and changing the effects. You could also give it a low rate system sort of thing, by increasing the amount of stats needed to resist status effects / Instant cast. I really wanted to start a high rate, and I wish I've done such before I started off my mid rate server so I could customise things the way I wanted it to.

  6. That's actually source mod.

    Anyway change:

    Mob.c

    #if PACKETVER >= 20120404
    if( !(md->status.mode&MDBOSS) ){
    	int i;
    	for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
    		struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
    		if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
    			clif_monster_hp_bar(md, sd->fd);
    	}
    }
    #endif
    

    to

    #if PACKETVER >= 20120404
    if( !(md->class_ == MOBID_EMPERIUM) ){
    	int i;
    	for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
    		struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
    		if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
    			clif_monster_hp_bar(md, sd->fd);
    	}
    }
    #endif
    

  7. Emistry's script does exactly the same to what your script does, but in a cleaner fashion. "@login_time" is your "tick", and since "Tick" 's value will change again upon login, it is pointless to have it as a permanent variable stored in the database. The Variable Emistry used, isn't deleted upon 'end' but upon server restart.

×
×
  • Create New...