This commit is contained in:
Treeku
2014-06-06 12:48:09 +01:00
4 changed files with 140 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import sys
from resources.datatables import GcwRank
def handleRankUp(actor, newrank):
if newrank > GcwRank.LIEUTENANT:
actor.addAbility('pvp_retaliation_ability')
if newrank > GcwRank.CAPTAIN:
actor.addAbility('pvp_adrenaline_ability')
if newrank > GcwRank.MAJOR:
actor.addAbility('pvp_unstoppable_ability')
if newrank > GcwRank.LTCOLONEL:
actor.addAbility('pvp_last_man_ability')
if newrank > GcwRank.COLONEL:
actor.addAbility('pvp_aura_buff_self_ability')
if newrank > GcwRank.GENERAL:
actor.addAbility('pvp_airstrike_ability')
return
def handleRankDown(actor, newrank):
if newrank < GcwRank.LIEUTENANT:
actor.removeAbility('pvp_retaliation_ability')
if newrank < GcwRank.CAPTAIN:
actor.removeAbility('pvp_adrenaline_ability')
if newrank < GcwRank.MAJOR:
actor.removeAbility('pvp_unstoppable_ability')
if newrank < GcwRank.LTCOLONEL:
actor.removeAbility('pvp_last_man_ability')
if newrank < GcwRank.COLONEL:
actor.removeAbility('pvp_aura_buff_self_ability')
if newrank < GcwRank.GENERAL:
actor.removeAbility('pvp_airstrike_ability')
return
+44
View File
@@ -0,0 +1,44 @@
import sys
from resources.datatables import GcwRank
def handleRankUp(actor, newrank):
if newrank > GcwRank.LIEUTENANT:
actor.addAbility('pvp_retaliation_rebel_ability')
if newrank > GcwRank.CAPTAIN:
actor.addAbility('pvp_adrenaline_rebel_ability')
if newrank > GcwRank.MAJOR:
actor.addAbility('pvp_unstoppable_rebel_ability')
if newrank > GcwRank.COMMANDER:
actor.addAbility('pvp_last_man_rebel_ability')
if newrank > GcwRank.COLONEL:
actor.addAbility('pvp_aura_buff_self_rebel_ability')
if newrank > GcwRank.GENERAL:
actor.addAbility('pvp_airstrike_rebel_ability')
return
def handleRankDown(actor, newrank):
if newrank < GcwRank.LIEUTENANT:
actor.removeAbility('pvp_retaliation_rebel_ability')
if newrank < GcwRank.CAPTAIN:
actor.removeAbility('pvp_adrenaline_rebel_ability')
if newrank < GcwRank.MAJOR:
actor.removeAbility('pvp_unstoppable_rebel_ability')
if newrank < GcwRank.COMMANDER:
actor.removeAbility('pvp_last_man_rebel_ability')
if newrank < GcwRank.COLONEL:
actor.removeAbility('pvp_aura_buff_self_rebel_ability')
if newrank < GcwRank.GENERAL:
actor.removeAbility('pvp_airstrike_rebel_ability')
return
+47
View File
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.datatables;
public class GcwRank {
// Shared ranks
public static final int PRIVATE = 1;
public static final int SERGEANT = 4;
public static final int SERGEANTMAJOR = 6;
public static final int LIEUTENANT = 7;
public static final int CAPTAIN = 8;
public static final int MAJOR = 9;
public static final int COLONEL = 11;
public static final int GENERAL = 12;
// Rebel ranks
public static final int TROOPER = 2;
public static final int HIGHTROOPER = 3;
public static final int SENIORSERGEANT = 5;
public static final int COMMANDER = 10;
// Imperial ranks
public static final int CORPORAL = 2;
public static final int LANCECORPORAL = 3;
public static final int MASTERSERGEANT = 5;
public static final int LTCOLONEL = 10;
}
+5
View File
@@ -555,6 +555,11 @@ public class GCWService implements INetworkDispatch {
player.setCurrentRank(newrank);
player.setRankProgress((float) Math.floor(newprogress));
if (newrank > oldrank)
core.scriptService.callScript("scripts/gcw/", "gcwrank_" + actor.getFaction(), "handleRankUp", actor, newrank);
else
core.scriptService.callScript("scripts/gcw/", "gcwrank_" + actor.getFaction(), "handleRankDown", actor, newrank);
}
public List<SWGObject> getSFPlayers() {