Пример #1
0
void ARX_SPELLS_AnalyseSYMBOL() {
	
	long sm = 0;
	try {
		sm = boost::lexical_cast<long>(SpellMoves);
	} catch(...) {
		LogDebug("bad spell moves: " << SpellMoves);
	}
	
	switch(sm) {
		
		// COSUM
		case 62148  :
		case 632148 :
		case 62498  :
		case 62748  :
		case 6248   :
				SpellSymbol[CurrSpellSymbol++] = RUNE_COSUM;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_COSUM);
			break;

		// COMUNICATUM
		case 632426 :
		case 627426 :
		case 634236 :
		case 624326 :
		case 62426  :
				SpellSymbol[CurrSpellSymbol++] = RUNE_COMUNICATUM;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_COMUNICATUM);
			break;

		// FOLGORA
		case 9823   :
		case 9232   :
		case 983    :
		case 963    :
		case 923    :
		case 932    :
		case 93     :
				SpellSymbol[CurrSpellSymbol++] = RUNE_FOLGORA;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_FOLGORA);
			break;

		// SPACIUM
		case 42368  :
		case 42678  :
		case 42698  :
		case 4268   :
				SpellSymbol[CurrSpellSymbol++] = RUNE_SPACIUM;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_SPACIUM);
			break;

		// TERA
		case 9826   :
		case 92126  :
		case 9264   :
		case 9296   :
		case 926    :
				SpellSymbol[CurrSpellSymbol++] = RUNE_TERA;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_TERA);
			break;

		// CETRIUS
		case 286   :
		case 3286  :
		case 23836 :
		case 38636 :
		case 2986  :
		case 2386  :
		case 386   :
				SpellSymbol[CurrSpellSymbol++] = RUNE_CETRIUS;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_CETRIUS);
			break;

		// RHAA
		case 28    :
		case 2     :
				SpellSymbol[CurrSpellSymbol++] = RUNE_RHAA;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_RHAA);
			break;

		// FRIDD
		case 98362	:
		case 8362	:
		case 8632	:
		case 8962	:
		case 862	:
				SpellSymbol[CurrSpellSymbol++] = RUNE_FRIDD;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_FRIDD);
			break;

		// KAOM
		case 41236	:
		case 23		:
		case 236	:
		case 2369	:
		case 136	:
		case 12369	:
		case 1236	:
				if(cur_arm >= 0 && (cur_arm & 1)){
					cur_arm++;					

					if(cur_arm > 20)
						ApplySPArm();
				}
				else
					cur_arm=-1;

				SpellSymbol[CurrSpellSymbol++] = RUNE_KAOM;

				if((size_t)CurrSpellSymbol >= MAX_SPELL_SYMBOLS) {
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;
				}

				ARX_SOUND_PlaySFX(SND_SYMB_KAOM);
			break;

		// STREGUM
		case 82328 :
		case 8328  :
		case 2328  :
		case 8938  :
		case 8238  :
		case 838   :
				SpellSymbol[CurrSpellSymbol++] = RUNE_STREGUM;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_STREGUM);
			break;

		// MORTE
		case 628   :
		case 621   :
		case 62    :
				SpellSymbol[CurrSpellSymbol++] = RUNE_MORTE;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_MORTE);
			break;

		// TEMPUS
		case 962686  :
		case 862686  :
		case 8626862 : 
				SpellSymbol[CurrSpellSymbol++] = RUNE_TEMPUS;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_TEMPUS);
			break;

		// MOVIS
		case 6316:
		case 61236:
		case 6146:
		case 61216:
		case 6216:
		case 6416:
		case 62126:
		case 61264:
		case 6126:
		case 6136:
		case 616: 
				SpellSymbol[CurrSpellSymbol++] = RUNE_MOVIS;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_MOVIS);
			break;

		// NHI
		case 46:
		case 4:
				SpellSymbol[CurrSpellSymbol++] = RUNE_NHI;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_NHI);
			break;

		// AAM
		case 64:
		case 6:
				SpellSymbol[CurrSpellSymbol++] = RUNE_AAM;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_AAM);
			break;
																		
		// YOK
		case 412369:
		case 2687:
		case 2698:
		case 2638:
		case 26386:
		case 2368:
		case 2689:
		case 268:
				SpellSymbol[CurrSpellSymbol++] = RUNE_YOK;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_YOK);
			break;

		// TAAR
		case 6236:
		case 6264:
		case 626:
				SpellSymbol[CurrSpellSymbol++] = RUNE_TAAR;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_TAAR);
			break;

		// MEGA
		case 82:
		case 8:
				if(cur_arm >= 0 && !(cur_arm & 1))
					cur_arm++;					
				else
					cur_arm=-1;

				SpellSymbol[CurrSpellSymbol++] = RUNE_MEGA;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_MEGA);
			break;

		// VISTA
		case 3614:
		case 361:
		case 341:
		case 3212:
		case 3214:
		case 312:
		case 314:
		case 321:
		case 31:
				SpellSymbol[CurrSpellSymbol++] = RUNE_VISTA;

				if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
					CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

				ARX_SOUND_PlaySFX(SND_SYMB_VISTA);
			break;

		// VITAE
		case 698:
		case 68:
			SpellSymbol[CurrSpellSymbol++] = RUNE_VITAE;

			if(CurrSpellSymbol >= MAX_SPELL_SYMBOLS)
				CurrSpellSymbol = MAX_SPELL_SYMBOLS - 1;

			ARX_SOUND_PlaySFX(SND_SYMB_VITAE);
			break;

//--------------------------------------------------------------------------------------------------------------------
// Cheat spells

		// Special UW mode
		case 238:
		case 2398:
		case 23898:
		case 236987:
		case 23698:	
			if(uw_mode_pos == 0)
				uw_mode_pos++;
		
			goto failed; 
		break;
		case 2382398:
		case 2829:
		case 23982398:
		case 39892398:
		case 2398938:
		case 28239898:
		case 238982398:
		case 238923898:
		case 28982398:
		case 3923989:
		case 292398:
		case 398329:
		case 38923898:
		case 2398289:
		case 289823898:
		case 2989238:
		case 29829:
		case 2393239:
		case 38239:
		case 239829:
		case 2898239:
		case 28982898:
		case 389389:
		case 3892389:
		case 289289:
		case 289239:
		case 239289:
		case 2989298:
		case 2392398:
		case 238929:
		case 28923898:
		case 2929:
		case 2398298:
		case 239823898:
		case 28238:
		case 2892398:
		case 28298:
		case 298289:
		case 38929:
		case 289298989:
		case 23892398:
		case 238239:
		case 29298:
		case 2329298:
		case 232389829:
		case 2389829:
		case 239239:
		case 282398:
		case 2389239:
		case 2929898:
		case 3292398:
		case 23923298:
		case 23898239:
		case 3232929:
		case 2982398:
		case 238298:
		case 3939:
			if(uw_mode_pos == 1)
				ApplySPuw();

			goto failed; 
		case 161:
		case 1621:
		case 1261: {
			if(cur_sm == 0)
				cur_sm++;

			if(cur_bh == 0)
				cur_bh++;

			if(cur_bh == 2)
				cur_bh++;

			if(cur_sos == 0)
				cur_sos++;

			if(cur_sos == 2) {
				cur_sos = 0;
				ApplyCurSOS();
			}

			goto failed;
		}
		case 83614:
		case 8361:
		case 8341:
		case 83212:
		case 83214:
		case 8312:
		case 8314:
		case 8321:
		case 831:
		case 82341:
		case 834:
		case 823:
		case 8234:
		case 8231: {
			if(cur_pom == 0)
				cur_pom++;

			if(cur_pnux == 0)
				cur_pnux++;

			if(cur_pnux == 2)
				cur_pnux++;

			if(cur_bh == 1)
				cur_bh++;

			if(cur_bh == 3) {
				cur_bh = 0;
				EERIE_OBJECT_SetBHMode();
			}

			goto failed;
		}
		case 83692:
		case 823982:
		case 83982:
		case 82369892:
		case 82392:
		case 83892:
		case 823282:
		case 8392: {
			if(cur_sm == 2) {
				cur_sm++;
				ApplySPBow();
			}

			if(cur_mx == 0)
				cur_mx = 1;

			if(cur_mr == 0)
				cur_mr = 1;

			if(cur_pom == 2) {
				cur_pom++;
				ApplySPWep();
			}

			goto failed;
		}
		case 98324:
		case 92324:
		case 89324:
		case 9324:
		case 9892324:
		case 9234:
		case 934: {
			if(cur_mr == 1) {
				cur_mr = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_mx == 1) {
				cur_mx = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_rf == 1) {
				cur_rf = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_sm == 1)
				cur_sm++;

			goto failed;
		}
		case 3249:
		case 2349:
		case 323489:
		case 23249:
		case 3489:
		case 32498:
		case 349: {
			if(cur_mx == 2) {
				cur_mx = 3;
				ApplySPMax();
			}

			goto failed;
		}
		case 26: {
			if(cur_pnux == 1)
				cur_pnux++;

			if(cur_pnux == 3) {
				cur_pnux++;
				ApplyCurPNux();
			}

			goto failed;
		}
		case 9232187:
		case 93187:
		case 9234187:
		case 831878:
		case 923187:
		case 932187:
		case 93217:
		case 9317: {
			if(cur_pom == 1)
				cur_pom++;

			if(cur_sos == 1)
				cur_sos++;

			goto failed;
		}
		case 82313:
		case 8343:
		case 82343:
		case 83413:
		case 8313: {
			if(cur_mr == 2) {
				cur_mr = 3;
				MakeCoolFx(player.pos);
				ApplyCurMr();
			}

			if(cur_rf == 0)
				cur_rf = 1;

			goto failed;
		}
		case 86: {
			if(cur_rf == 2) {
				cur_rf = 3;
				MakeCoolFx(player.pos);
				ApplySPRf();
			}

			goto failed;
		}
		case 626262: {
			passwall++;

			if(passwall == 3) {
				passwall=0;
				ApplyPasswall(); 
			}
		}
		break;
		case 828282: {
			player.skin++;

			if(player.skin == 4 && rnd() < 0.9f)
				player.skin++;

			if(player.skin > 5)
				player.skin = 0;

			ARX_EQUIPMENT_RecreatePlayerMesh();
			goto failed;
		}
		default: {
		failed:
			;
			std::string tex;

			if(SpellMoves.length()>=127)
				SpellMoves.resize(127);

			LAST_FAILED_SEQUENCE = SpellMoves;

			LogDebug("Unknown Symbol - " + SpellMoves);
		}
	}

	bPrecastSpell = false;

	// wanna precast?
	if(GInput->actionPressed(CONTROLS_CUST_STEALTHMODE)) {
		bPrecastSpell = true;
	}
}
Пример #2
0
void handleCheatRuneDetection(CheatRune rune) {
	switch(rune) {
		case CheatRune_KAOM: {
			if(cur_arm >= 0 && (cur_arm & 1)){
				cur_arm++;

				if(cur_arm > 20)
					ApplySPArm();
			}
			else
				cur_arm=-1;
			
			break;
		}
		case CheatRune_MEGA: {
			if(cur_arm >= 0 && !(cur_arm & 1))
				cur_arm++;
			else
				cur_arm=-1;
			
			break;
		}
		case CheatRune_U: {
			if(uw_mode_pos == 0)
				uw_mode_pos++;
			
			break;
		}
		case CheatRune_W: {
			if(uw_mode_pos == 1)
				ApplySPuw();
			
			break;
		}
		case CheatRune_S: {
			if(cur_sm == 0)
				cur_sm++;

			if(cur_bh == 0)
				cur_bh++;

			if(cur_bh == 2)
				cur_bh++;

			if(cur_sos == 0)
				cur_sos++;

			if(cur_sos == 2) {
				cur_sos = 0;
				ApplyCurSOS();
			}
			break;
		}
		case CheatRune_P: {
			if(cur_pom == 0)
				cur_pom++;

			if(cur_pnux == 0)
				cur_pnux++;

			if(cur_pnux == 2)
				cur_pnux++;

			if(cur_bh == 1)
				cur_bh++;

			if(cur_bh == 3) {
				cur_bh = 0;
				EERIE_OBJECT_SetBHMode();
			}
			break;
		}
		case CheatRune_M: {
			if(cur_sm == 2) {
				cur_sm++;
				ApplySPBow();
			}

			if(cur_mx == 0)
				cur_mx = 1;

			if(cur_mr == 0)
				cur_mr = 1;

			if(cur_pom == 2) {
				cur_pom++;
				ApplySPWep();
			}
			break;
		}
		case CheatRune_A: {
			if(cur_mr == 1) {
				cur_mr = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_mx == 1) {
				cur_mx = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_rf == 1) {
				cur_rf = 2;
				MakeCoolFx(player.pos);
			}

			if(cur_sm == 1)
				cur_sm++;
			
			break;
		}
		case CheatRune_X: {
			if(cur_mx == 2) {
				cur_mx = 3;
				ApplySPMax();
			}
			break;
		}
		case CheatRune_26: {
			if(cur_pnux == 1)
				cur_pnux++;

			if(cur_pnux == 3) {
				cur_pnux++;
				ApplyCurPNux();
			}
			break;
		}
		case CheatRune_O: {
			if(cur_pom == 1)
				cur_pom++;

			if(cur_sos == 1)
				cur_sos++;
			
			break;
		}
		case CheatRune_R: {
			if(cur_mr == 2) {
				cur_mr = 3;
				MakeCoolFx(player.pos);
				ApplyCurMr();
			}

			if(cur_rf == 0)
				cur_rf = 1;
			
			break;
		}
		case CheatRune_F: {
			if(cur_rf == 2) {
				cur_rf = 3;
				MakeCoolFx(player.pos);
				ApplySPRf();
			}
			break;
		}
		case CheatRune_Passwall: {
			passwall++;

			if(passwall == 3) {
				passwall=0;
				ApplyPasswall();
			}
			break;
		}
		case CheatRune_ChangeSkin: {
			player.skin++;

			if(player.skin == 4 && Random::getf() < 0.9f)
				player.skin++;

			if(player.skin > 5)
				player.skin = 0;

			ARX_EQUIPMENT_RecreatePlayerMesh();
			break;
		}
	}
}