void ApplySPArm() { ARX_SPSound(); res::path cls; switch (sp_arm) { case 0: cls = "graph/obj3d/interactive/items/armor/helmet_plate_cm/helmet_plate_cm"; break; case 1: cls = "graph/obj3d/interactive/items/armor/legging_plate_cm/legging_plate_cm"; break; case 2: cls = "graph/obj3d/interactive/items/armor/chest_plate_cm/chest_plate_cm"; break; default: return; break; } Entity * ioo = AddItem(cls); if(ioo) { sp_wep = 1; MakeCoolFx(player.pos); MakeCoolFx(player.pos); ioo->scriptload = 1; SendInitScriptEvent(ioo); giveToPlayer(ioo); MakeSpCol(); sp_max_ch = "!! Toi aussi cherches les Cheats !!"; switch (sp_arm) { case 0: sp_max_ch = "------ZoliChapo------"; break; case 1: sp_max_ch = "-----TiteBottine-----"; break; case 2: sp_max_ch = "-----Roooo-La-La-----"; break; default: return; break; } sp_max_start=arxtime.get_updated(); } sp_arm++; }
void SummonCreatureSpell::End() { lightHandleDestroy(m_light); // need to killio if(ValidIONum(m_summonedEntity)) { Entity * io = entities[m_summonedEntity]; ARX_SOUND_PlaySFX(SND_SPELL_ELECTRIC, &io->pos); if(io->scriptload && (io->ioflags & IO_NOSAVE)) { AddRandomSmoke(io, 100); Vec3f posi = io->pos; posi.y -= 100.f; MakeCoolFx(posi); LightHandle nn = GetFreeDynLight(); if(lightHandleIsValid(nn)) { EERIE_LIGHT * light = lightHandleGet(nn); light->intensity = Random::getf(0.7f, 2.7f); light->fallend = 600.f; light->fallstart = 400.f; light->rgb = Color3f(1.0f, 0.8f, 0.0f); light->pos = posi; light->duration = 600; } io->destroyOne(); } } m_summonedEntity = EntityHandle(); }
void RiseDeadSpell::End() { if(ValidIONum(m_entity)) { Entity *entity = entities[m_entity]; ARX_SOUND_PlaySFX(SND_SPELL_ELECTRIC, &entity->pos); if(entity->scriptload && (entity->ioflags & IO_NOSAVE)) { AddRandomSmoke(entity,100); Vec3f posi = entity->pos; posi.y-=100.f; MakeCoolFx(posi); LightHandle nn = GetFreeDynLight(); if(lightHandleIsValid(nn)) { EERIE_LIGHT * light = lightHandleGet(nn); light->intensity = Random::getf(0.7f, 2.7f); light->fallend = 600.f; light->fallstart = 400.f; light->rgb = Color3f(1.0f, 0.8f, 0.f); light->pos = posi; light->duration = 600; } entity->destroyOne(); } } endLightDelayed(m_light, 500); }
static void ApplySPMax() { MakeCoolFx(player.pos); sp_max = ~sp_max; if (sp_max) { MakeSpCol(); DisplayCheatText("!!!_FaNt0mAc1e_!!!"); player.skin = 4; ARX_EQUIPMENT_RecreatePlayerMesh(); ARX_PLAYER_Rune_Add_All(); std::string text = "!!!!!!! FanTomAciE !!!!!!!"; notification_add(text); player.Attribute_Redistribute += 10; player.Skill_Redistribute += 50; player.level = std::max(player.level, short(10)); player.xp = GetXPforLevel(10); } else { TextureContainer * tcm; tcm = TextureContainer::Load("graph/obj3d/textures/npc_human_cm_hero_head"); if(tcm) { delete tcm; player.heads[0] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero_head"); player.heads[1] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero2_head"); player.heads[2] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero3_head"); ARX_EQUIPMENT_RecreatePlayerMesh(); } } }
static void ApplySPuw() { uw_mode_pos=0; uw_mode=~uw_mode; ARX_SOUND_PlayCinematic("menestrel_uw2", true); MakeCoolFx(player.pos); if(uw_mode) { MakeSpCol(); DisplayCheatText("~-__-~~-__.U.W.__-~~-__-~"); } }
static void EERIE_OBJECT_SetBHMode() { if(BH_MODE) { BH_MODE = 0; } else { BH_MODE = 1; MakeCoolFx(player.pos); MakeSpCol(); DisplayCheatText("!!!_Super-Deformed_!!!"); } }
static void ApplySPBow() { ARX_SPSound(); const char * cls = "graph/obj3d/interactive/items/weapons/bow_mx/bow_mx"; Entity * ioo = AddItem(cls); if(ioo) { MakeCoolFx(player.pos); MakeCoolFx(player.pos); ioo->scriptload = 1; SendInitScriptEvent(ioo); giveToPlayer(ioo); MakeSpCol(); DisplayCheatText("!!!_Bow to Samy & Anne_!!!"); } }
void ApplySPuw() { uw_mode_pos=0; uw_mode=~uw_mode; ARX_SOUND_PlayCinematic("menestrel_uw2", true); MakeCoolFx(player.pos); if(uw_mode) { MakeSpCol(); sp_max_ch = "~-__-~~-__.U.W.__-~~-__-~"; sp_max_start=arxtime.get_updated(); } }
void FakeSummonSpell::Update() { if(!g_gameTime.isPaused()) { if(Random::getf() > 0.7f) { Vec3f pos = m_fissure.m_eSrc; MakeCoolFx(pos); } } m_fissure.Update(g_gameTime.lastFrameDuration()); m_fissure.Render(); }
void ApplySPBow() { ARX_SPSound(); const char * cls = "graph/obj3d/interactive/items/weapons/bow_mx/bow_mx"; Entity * ioo = AddItem(cls); if(ioo) { MakeCoolFx(player.pos); MakeCoolFx(player.pos); ioo->scriptload = 1; SendInitScriptEvent(ioo); giveToPlayer(ioo); MakeSpCol(); sp_max_ch = "!!!_Bow to Samy & Anne_!!!"; sp_max_start=arxtime.get_updated(); } }
void FakeSummonSpell::Update() { if(!arxtime.is_paused()) { if(Random::getf() > 0.7f) { Vec3f pos = m_fissure.m_eSrc; MakeCoolFx(pos); } } m_fissure.Update(g_framedelay); m_fissure.Render(); }
void EERIE_OBJECT_SetBHMode() { if (BH_MODE) BH_MODE=0; else { BH_MODE=1; MakeCoolFx(player.pos); MakeSpCol(); sp_max_ch = "!!!_Super-Deformed_!!!"; sp_max_start=arxtime.get_updated(); } }
static void ApplySPWep() { if(!sp_wep) { ARX_SPSound(); res::path cls = "graph/obj3d/interactive/items/weapons/sword_mx/sword_mx"; Entity * ioo = AddItem(cls); if(ioo) { sp_wep = 1; MakeCoolFx(player.pos); MakeCoolFx(player.pos); ioo->scriptload = 1; SendInitScriptEvent(ioo); giveToPlayer(ioo); MakeSpCol(); DisplayCheatText("!!!_Grosbillite_!!!"); } } }
void ApplySPWep() { if(!sp_wep) { ARX_SPSound(); res::path cls = "graph/obj3d/interactive/items/weapons/sword_mx/sword_mx"; Entity * ioo = AddItem(cls); if(ioo) { sp_wep = 1; MakeCoolFx(player.pos); MakeCoolFx(player.pos); ioo->scriptload = 1; SendInitScriptEvent(ioo); giveToPlayer(ioo); MakeSpCol(); sp_max_ch = "!!!_Grosbillite_!!!"; sp_max_start=arxtime.get_updated(); } } }
void ApplySPMax() { MakeCoolFx(player.pos); sp_max=~sp_max; if (sp_max) { MakeSpCol(); sp_max_ch = "!!!_FaNt0mAc1e_!!!"; sp_max_start=arxtime.get_updated(); player.skin=4; ARX_EQUIPMENT_RecreatePlayerMesh(); ARX_PLAYER_Rune_Add_All(); std::string text = "!!!!!!! FanTomAciE !!!!!!!"; ARX_SPEECH_Add(text); player.Attribute_Redistribute+=10; player.Skill_Redistribute+=50; player.level=std::max((int)player.level,10); player.xp=GetXPforLevel(10); } else { TextureContainer * tcm; tcm = TextureContainer::Load("graph/obj3d/textures/npc_human_cm_hero_head"); if(tcm) { delete tcm; player.heads[0] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero_head"); player.heads[1] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero2_head"); player.heads[2] = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero3_head"); ARX_EQUIPMENT_RecreatePlayerMesh(); } } }
void MakePlayerAppearsFX(Entity * io) { MakeCoolFx(io->pos); MakeCoolFx(io->pos); AddRandomSmoke(io, 30); ARX_PARTICLES_Add_Smoke(io->pos, 1 | 2, 20); // flag 1 = randomize pos }
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; } }
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; } } }
void RiseDeadSpell::Update(float timeDelta) { if(m_creationFailed) { m_light = LightHandle(); return; } m_duration+=200; m_fissure.Update(timeDelta); m_fissure.Render(); if(lightHandleIsValid(m_light)) { EERIE_LIGHT * light = lightHandleGet(m_light); light->intensity = 0.7f + 2.3f; light->fallend = 500.f; light->fallstart = 400.f; light->rgb = Color3f(0.8f, 0.2f, 0.2f); light->duration=800; light->time_creation = (unsigned long)(arxtime); } unsigned long tim = m_fissure.ulCurrentTime; if(tim > 3000 && m_entity == EntityHandle() && !m_creationFailed) { ARX_SOUND_PlaySFX(SND_SPELL_ELECTRIC, &m_targetPos); Cylinder phys = Cylinder(m_targetPos, 50, -200); float anything = CheckAnythingInCylinder(phys, NULL, CFLAG_JUST_TEST); if(glm::abs(anything) < 30) { const char * cls = "graph/obj3d/interactive/npc/undead_base/undead_base"; Entity * io = AddNPC(cls, -1, IO_IMMEDIATELOAD); if(io) { ARX_INTERACTIVE_HideGore(io); RestoreInitialIOStatusOfIO(io); io->summoner = m_caster; io->ioflags|=IO_NOSAVE; m_entity = io->index(); io->scriptload=1; ARX_INTERACTIVE_Teleport(io, phys.origin); SendInitScriptEvent(io); if(ValidIONum(m_caster)) { EVENT_SENDER = entities[m_caster]; } else { EVENT_SENDER = NULL; } SendIOScriptEvent(io,SM_SUMMONED); Vec3f pos = m_fissure.m_eSrc; pos += randomVec3f() * 100.f; pos += Vec3f(-50.f, 50.f, -50.f); MakeCoolFx(pos); } m_light = LightHandle(); } else { ARX_SOUND_PlaySFX(SND_MAGIC_FIZZLE); m_creationFailed = true; m_duration=0; } } else if(!arxtime.is_paused() && tim < 4000) { if(Random::getf() > 0.95f) { MakeCoolFx(m_fissure.m_eSrc); } } }
void SummonCreatureSpell::Update() { if(arxtime.is_paused()) return; float elapsed = arxtime.now_f() - m_timcreation; if(elapsed <= 4000) { if(Random::getf() > 0.7f) { Vec3f pos = m_fissure.m_eSrc; MakeCoolFx(pos); } m_fissure.Update(g_framedelay); m_fissure.Render(); m_requestSummon = true; m_summonedEntity = EntityHandle(); } else if(m_requestSummon) { lightHandleDestroy(m_light); m_requestSummon = false; ARX_SOUND_PlaySFX(SND_SPELL_ELECTRIC, &m_targetPos); Cylinder phys = Cylinder(m_targetPos, 50, -200); float anything = CheckAnythingInCylinder(phys, NULL, CFLAG_JUST_TEST); if(glm::abs(anything) < 30) { long tokeep; res::path cls; if(m_megaCheat) { if(Random::getf() > 0.5f) { tokeep = -1; cls = "graph/obj3d/interactive/npc/wrat_base/wrat_base"; } else { tokeep = 0; cls = "graph/obj3d/interactive/npc/y_mx/y_mx"; } } else if(Random::getf() > 0.997f || (sp_max && Random::getf() > 0.8f) || (cur_mr >= 3 && Random::getf() > 0.3f)) { tokeep = 0; cls = "graph/obj3d/interactive/npc/y_mx/y_mx"; } else if(Random::getf() > 0.997f || (cur_rf >= 3 && Random::getf() > 0.8f) || (cur_mr >= 3 && Random::getf() > 0.3f)) { tokeep = -1; cls = "graph/obj3d/interactive/npc/wrat_base/wrat_base"; } else if(m_level >= 9) { tokeep = 1; cls = "graph/obj3d/interactive/npc/demon/demon"; } else if(Random::getf() > 0.98f) { tokeep = -1; cls = "graph/obj3d/interactive/npc/wrat_base/wrat_base"; } else { tokeep = 0; cls = "graph/obj3d/interactive/npc/chicken_base/chicken_base"; } Entity * io = AddNPC(cls, -1, IO_IMMEDIATELOAD); if(!io) { cls = "graph/obj3d/interactive/npc/chicken_base/chicken_base"; tokeep = 0; io = AddNPC(cls, -1, IO_IMMEDIATELOAD); } if(io) { RestoreInitialIOStatusOfIO(io); io->summoner = m_caster; io->scriptload = 1; if(tokeep == 1) { io->ioflags |= IO_NOSAVE; } io->pos = phys.origin; SendInitScriptEvent(io); if(tokeep < 0) { io->scale=1.65f; io->physics.cyl.radius=25; io->physics.cyl.height=-43; io->speed_modif=1.f; } if(ValidIONum(m_caster)) { EVENT_SENDER = entities[m_caster]; } else { EVENT_SENDER = NULL; } SendIOScriptEvent(io,SM_SUMMONED); for(long j = 0; j < 3; j++) { Vec3f pos = m_fissure.m_eSrc; pos += randomVec3f() * 100.f; pos += Vec3f(-50.f, 50.f, -50.f); MakeCoolFx(pos); } if(tokeep==1) m_summonedEntity = io->index(); else m_summonedEntity = EntityHandle(); } } } else if(m_summonedEntity == EntityHandle()) { m_duration = 0; } }