@ -25,7 +25,6 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums.* ;
import engine.mbEnums.* ;
import engine.net.ByteBufferWriter ;
import engine.net.ByteBufferWriter ;
import engine.net.Dispatch ;
import engine.net.Dispatch ;
import engine.net.DispatchMessage ;
import engine.net.client.ClientConnection ;
import engine.net.client.ClientConnection ;
import engine.net.client.msg.* ;
import engine.net.client.msg.* ;
import engine.objects.* ;
import engine.objects.* ;
@ -191,7 +190,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
Dispatch dispatch = Dispatch . borrow ( origin . getPlayerCharacter ( ) , recyclePowerMsg ) ;
Dispatch dispatch = Dispatch . borrow ( origin . getPlayerCharacter ( ) , recyclePowerMsg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
// Send Fail to cast message
// Send Fail to cast message
PlayerCharacter pc = SessionManager
PlayerCharacter pc = SessionManager
@ -244,7 +243,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , recyclePowerMsg ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , recyclePowerMsg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
return false ;
return false ;
}
}
@ -488,7 +487,7 @@ public enum PowersManager {
0f , 0f , 0 , null ,
0f , 0f , 0 , null ,
9999 , 0 ) ;
9999 , 0 ) ;
mhm . setOmitFromChat ( 1 ) ;
mhm . setOmitFromChat ( 1 ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , mhm , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , mhm , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
}
}
else if ( pb . useMana ( ) )
else if ( pb . useMana ( ) )
if ( playerCharacter . getMana ( ) < cost )
if ( playerCharacter . getMana ( ) < cost )
@ -519,7 +518,7 @@ public enum PowersManager {
// else send recycle message to unlock power
// else send recycle message to unlock power
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( msg . getPowerUsedID ( ) ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , recyclePowerMsg ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , recyclePowerMsg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
}
}
//what the fuck?
//what the fuck?
@ -529,7 +528,7 @@ public enum PowersManager {
// else
// else
// msg.setUnknown04(1); // Regular Race, use mana?
// msg.setUnknown04(1); // Regular Race, use mana?
int tr = msg . getNumTrains ( ) ;
int tr = msg . getNumTrains ( ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , msg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , sendCastToSelf , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , msg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , sendCastToSelf , false ) ;
//Make new msg..
//Make new msg..
PerformActionMsg copyMsg = new PerformActionMsg ( msg ) ;
PerformActionMsg copyMsg = new PerformActionMsg ( msg ) ;
@ -540,7 +539,7 @@ public enum PowersManager {
playerCharacter . update ( ) ;
playerCharacter . update ( ) ;
playerCharacter . setSit ( false ) ;
playerCharacter . setSit ( false ) ;
UpdateStateMsg updateStateMsg = new UpdateStateMsg ( playerCharacter ) ;
UpdateStateMsg updateStateMsg = new UpdateStateMsg ( playerCharacter ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , updateStateMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , updateStateMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
}
}
@ -683,8 +682,8 @@ public enum PowersManager {
msg . setNumTrains ( 9999 ) ;
msg . setNumTrains ( 9999 ) ;
DispatchMessage . sendToAllInRange ( caster , msg ) ;
DispatchManager . sendToAllInRange ( caster , msg ) ;
DispatchMessage . sendToAllInRange ( caster , msg ) ;
DispatchManager . sendToAllInRange ( caster , msg ) ;
msg . setNumTrains ( tr ) ;
msg . setNumTrains ( tr ) ;
@ -751,7 +750,7 @@ public enum PowersManager {
performActionMsg . setUnknown04 ( 2 ) ;
performActionMsg . setUnknown04 ( 2 ) ;
dispatch = Dispatch . borrow ( playerCharacter , performActionMsg ) ;
dispatch = Dispatch . borrow ( playerCharacter , performActionMsg ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , performActionMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , performActionMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
return ;
return ;
}
}
@ -992,7 +991,7 @@ public enum PowersManager {
PerformActionMsg castMsg = new PerformActionMsg ( msg ) ;
PerformActionMsg castMsg = new PerformActionMsg ( msg ) ;
castMsg . setNumTrains ( 9999 ) ;
castMsg . setNumTrains ( 9999 ) ;
castMsg . setUnknown04 ( 2 ) ;
castMsg . setUnknown04 ( 2 ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , castMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , castMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
msgCasted = true ;
msgCasted = true ;
}
}
}
}
@ -1002,7 +1001,7 @@ public enum PowersManager {
PerformActionMsg castMsg = new PerformActionMsg ( msg ) ;
PerformActionMsg castMsg = new PerformActionMsg ( msg ) ;
castMsg . setNumTrains ( 9999 ) ;
castMsg . setNumTrains ( 9999 ) ;
castMsg . setUnknown04 ( 2 ) ;
castMsg . setUnknown04 ( 2 ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , castMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , castMsg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
msgCasted = true ;
msgCasted = true ;
}
}
@ -1063,7 +1062,7 @@ public enum PowersManager {
msg . setNumTrains ( 9999 ) ;
msg . setNumTrains ( 9999 ) ;
msg . setUnknown04 ( 2 ) ;
msg . setUnknown04 ( 2 ) ;
DispatchMessage . sendToAllInRange ( caster , msg ) ;
DispatchManager . sendToAllInRange ( caster , msg ) ;
// get target loc
// get target loc
Vector3fImmutable targetLoc = msg . getTargetLoc ( ) ;
Vector3fImmutable targetLoc = msg . getTargetLoc ( ) ;
@ -1170,7 +1169,7 @@ public enum PowersManager {
// TODO echo power use to everyone else
// TODO echo power use to everyone else
msg . setNumTrains ( 9999 ) ;
msg . setNumTrains ( 9999 ) ;
msg . setUnknown04 ( 2 ) ;
msg . setUnknown04 ( 2 ) ;
DispatchMessage . sendToAllInRange ( caster , msg ) ;
DispatchManager . sendToAllInRange ( caster , msg ) ;
}
}
@ -1248,7 +1247,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( token ) ;
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( token ) ;
Dispatch dispatch = Dispatch . borrow ( origin . getPlayerCharacter ( ) , recyclePowerMsg ) ;
Dispatch dispatch = Dispatch . borrow ( origin . getPlayerCharacter ( ) , recyclePowerMsg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
}
}
@ -1374,7 +1373,7 @@ public enum PowersManager {
PerformActionMsg msg = new PerformActionMsg ( pb . getToken ( ) ,
PerformActionMsg msg = new PerformActionMsg ( pb . getToken ( ) ,
trains , ac . getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , tarType , tarID , 0 ,
trains , ac . getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , tarType , tarID , 0 ,
0 , 0 , 1 , 0 ) ;
0 , 0 , 1 , 0 ) ;
DispatchMessage . sendToAllInRange ( target , msg ) ;
DispatchManager . sendToAllInRange ( target , msg ) ;
ConcurrentHashMap < String , JobContainer > timers = ac . getTimers ( ) ;
ConcurrentHashMap < String , JobContainer > timers = ac . getTimers ( ) ;
@ -1492,7 +1491,7 @@ public enum PowersManager {
. getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , target . getObjectType ( ) . ordinal ( ) ,
. getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , target . getObjectType ( ) . ordinal ( ) ,
target . getObjectUUID ( ) , 0 , 0 , 0 , 2 , 0 ) ;
target . getObjectUUID ( ) , 0 , 0 , 0 , 2 , 0 ) ;
DispatchMessage . sendToAllInRange ( ac , msg ) ;
DispatchManager . sendToAllInRange ( ac , msg ) ;
}
}
}
}
@ -1943,7 +1942,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( token ) ;
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg ( token ) ;
Dispatch dispatch = Dispatch . borrow ( pc , recyclePowerMsg ) ;
Dispatch dispatch = Dispatch . borrow ( pc , recyclePowerMsg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
}
}
@ -2103,12 +2102,12 @@ public enum PowersManager {
case 3 :
case 3 :
case 4 :
case 4 :
msg . setUnknown04 ( 2 ) ;
msg . setUnknown04 ( 2 ) ;
DispatchMessage . dispatchMsgToInterestArea ( playerCharacter , msg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( playerCharacter , msg , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
break ;
break ;
default :
default :
msg . setUnknown04 ( 1 ) ;
msg . setUnknown04 ( 1 ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , msg ) ;
Dispatch dispatch = Dispatch . borrow ( playerCharacter , msg ) ;
DispatchMessage . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
DispatchManager . dispatchMsgDispatch ( dispatch , DispatchChannel . PRIMARY ) ;
}
}
}
}
@ -2126,7 +2125,7 @@ public enum PowersManager {
ApplyEffectMsg aem = new ApplyEffectMsg ( pc , pc , 0 , eb . getToken ( ) , 9 , pb . getToken ( ) , pb . getName ( ) ) ;
ApplyEffectMsg aem = new ApplyEffectMsg ( pc , pc , 0 , eb . getToken ( ) , 9 , pb . getToken ( ) , pb . getName ( ) ) ;
aem . setUnknown03 ( type ) ;
aem . setUnknown03 ( type ) ;
DispatchMessage . dispatchMsgToInterestArea ( pc , aem , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( pc , aem , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
@ -2147,7 +2146,7 @@ public enum PowersManager {
aem . setUnknown03 ( type ) ;
aem . setUnknown03 ( type ) ;
aem . setUnknown05 ( 1 ) ;
aem . setUnknown05 ( 1 ) ;
DispatchMessage . dispatchMsgToInterestArea ( pc , aem , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
DispatchManager . dispatchMsgToInterestArea ( pc , aem , DispatchChannel . PRIMARY , MBServerStatics . CHARACTER_LOAD_RANGE , true , false ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
@ -2162,7 +2161,7 @@ public enum PowersManager {
switch ( type ) {
switch ( type ) {
case 3 :
case 3 :
case 4 :
case 4 :
DispatchMessage . sendToAllInRange ( mob , msg ) ;
DispatchManager . sendToAllInRange ( mob , msg ) ;
}
}
}
}
@ -2401,7 +2400,7 @@ public enum PowersManager {
if ( pam ! = null ) {
if ( pam ! = null ) {
pam . setNumTrains ( 9999 ) ;
pam . setNumTrains ( 9999 ) ;
pam . setUnknown04 ( 2 ) ;
pam . setUnknown04 ( 2 ) ;
DispatchMessage . sendToAllInRange ( ac , pam ) ;
DispatchManager . sendToAllInRange ( ac , pam ) ;
}
}
}
}
}
}
@ -2465,7 +2464,7 @@ public enum PowersManager {
PerformActionMsg pam = new PerformActionMsg ( pb . getToken ( ) , 9999 , ac
PerformActionMsg pam = new PerformActionMsg ( pb . getToken ( ) , 9999 , ac
. getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , target . getObjectType ( ) . ordinal ( ) ,
. getObjectType ( ) . ordinal ( ) , ac . getObjectUUID ( ) , target . getObjectType ( ) . ordinal ( ) ,
target . getObjectUUID ( ) , 0 , 0 , 0 , 2 , 0 ) ;
target . getObjectUUID ( ) , 0 , 0 , 0 , 2 , 0 ) ;
DispatchMessage . sendToAllInRange ( ac , pam ) ;
DispatchManager . sendToAllInRange ( ac , pam ) ;
}
}
}
}