enum Compiler::ErrorCode Compiler::screenGlobalFunctions(Script &pScript) {
  llvm::Module &module = pScript.getSource().getModule();

  // Materialize the bitcode module in case this is a lazy-load module.  Do not
  // clear the materializer by calling materializeAllPermanently since the
  // runtime library has not been merged into the module yet.
  if (module.getMaterializer() != nullptr) {
    std::error_code ec = module.materializeAll();
    if (ec) {
      ALOGE("Failed to materialize module `%s' when screening globals! (%s)",
            module.getModuleIdentifier().c_str(), ec.message().c_str());
      return kErrMaterialization;
    }
  }

  // Add pass to check for illegal function calls.
  llvm::legacy::PassManager pPM;
  pPM.add(createRSScreenFunctionsPass());
  pPM.run(module);

  return kSuccess;

}
void AddSC_desolace()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "npc_aged_dying_ancient_kodo";
    pNewScript->GetAI = &GetAI_npc_aged_dying_ancient_kodo;
    pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_aged_dying_ancient_kodo;
    pNewScript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_dalinda_malem";
    pNewScript->GetAI = &GetAI_npc_dalinda_malem;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_dalinda_malem;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_melizza_brimbuzzle";
    pNewScript->GetAI = &GetAI_npc_melizza_brimbuzzle;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_melizza_brimbuzzle;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_cork_gizelton";
    pNewScript->GetAI = &GetAI_npc_cork_gizelton;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_cork_gizelton;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_rigger_gizelton";
    pNewScript->GetAI = &GetAI_npc_rigger_gizelton;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_rigger_gizelton;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_magrami_spectre";
    pNewScript->GetAI = &GetAI_npc_magrami_spectre;
    pNewScript->RegisterSelf();
}
void AddSC_zangarmarsh()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npcs_ashyen_and_keleth";
    newscript->pGossipHello =  &GossipHello_npcs_ashyen_and_keleth;
    newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_cooshcoosh";
    newscript->pGossipHello =  &GossipHello_npc_cooshcoosh;
    newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_elder_kuruti";
    newscript->pGossipHello =  &GossipHello_npc_elder_kuruti;
    newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_mortog_steamhead";
    newscript->pGossipHello =  &GossipHello_npc_mortog_steamhead;
    newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_kayra_longmane";
    newscript->GetAI = &GetAI_npc_kayra_longmaneAI;
    newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_timothy_daniels";
    newscript->pGossipHello =  &GossipHello_npc_timothy_daniels;
    newscript->pGossipSelect = &GossipSelect_npc_timothy_daniels;
    newscript->RegisterSelf();
}
Exemple #4
0
void CharacterComponent::useSpecialOnBeing(Entity &user, int id, Entity *b)
{
    SpecialMap::iterator it = mSpecials.find(id);
    if (!specialUseCheck(it))
            return;
    SpecialValue &special = it->second;

    if (special.specialInfo->target != SpecialManager::TARGET_BEING)
        return;

    //tell script engine to cast the spell
    Script *script = ScriptManager::currentState();
    script->prepare(special.specialInfo->useCallback);
    script->push(&user);
    script->push(b);
    script->push(special.specialInfo->id);
    script->execute(user.getMap());
}
Exemple #5
0
void AddSC_credit()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_scarlet_onslaght_prisoner";
    newscript->GetAI = &GetAI_npc_scarlet_onslaght_prisoner;
    newscript->RegisterSelf();
    
    /*newscript = new Script;
    newscript->Name = "npc_investigate_building";
    newscript->GetAI = &GetAI_npc_investigate_building;
    newscript->RegisterSelf();*/
    
    newscript = new Script;
    newscript->Name = "npc_hebdrakkartrolls";
    newscript->GetAI = &GetAI_npc_hebdrakkartrolls;
    newscript->RegisterSelf();
    
    newscript = new Script;
    newscript->Name = "npc_frost_icepaw";
    newscript->GetAI = &GetAI_npc_frost_icepaw;
    newscript->RegisterSelf();
    
     newscript = new Script;
    newscript->Name = "npc_relozaz";
    newscript->GetAI = &GetAI_npc_relozaz;
    newscript->RegisterSelf();
    
    newscript = new Script;
    newscript->Name = "npc_magmothregar";
    newscript->GetAI = &GetAI_npc_magmothregar;
    newscript->RegisterSelf();
    
    newscript = new Script;
    newscript->Name = "npc_sentry_bot";
    newscript->GetAI = &GetAI_npc_sentry_bot;
    newscript->RegisterSelf();
}
void AddSC_eversong_woods()
{
    Script* s;

    s = new npc_kelerun_bloodmourn();
    s->RegisterSelf();
    s = new go_harbinger_second_trial();
    s->RegisterSelf();
    s = new npc_prospector_anvilward();
    s->RegisterSelf();
    s = new npc_apprentice_mirveda();
    s->RegisterSelf();
    s = new npc_infused_crystal();
    s->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_kelerun_bloodmourn";
    //pNewScript->GetAI = &GetAI_npc_kelerun_bloodmourn;
    //pNewScript->pQuestAcceptNPC = &QuestAccept_npc_kelerun_bloodmourn;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "go_harbinger_second_trial";
    //pNewScript->pGOUse = &GOUse_go_harbinger_second_trial;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_prospector_anvilward";
    //pNewScript->GetAI = &GetAI_npc_prospector_anvilward;
    //pNewScript->pGossipHello =  &GossipHello_npc_prospector_anvilward;
    //pNewScript->pGossipSelect = &GossipSelect_npc_prospector_anvilward;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_apprentice_mirveda";
    //pNewScript->GetAI = &GetAI_npc_apprentice_mirvedaAI;
    //pNewScript->pQuestAcceptNPC = &QuestAccept_unexpected_results;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_infused_crystal";
    //pNewScript->GetAI = &GetAI_npc_infused_crystalAI;
    //pNewScript->RegisterSelf();
}
void AddSC_blades_edge_mountains()
{
    Script* s;

    s = new mobs_nether_drake();
    s->RegisterSelf();
    s = new npc_daranelle();
    s->RegisterSelf();
    s = new npc_bloodmaul_stout_trigger();
    s->RegisterSelf();
    s = new npc_simon_game_bunny();
    s->RegisterSelf();
    s = new spell_simon_game_start();
    s->RegisterSelf();
    s = new spell_simon_game_move();
    s->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "mobs_nether_drake";
    //pNewScript->GetAI = &GetAI_mobs_nether_drake;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_daranelle";
    //pNewScript->GetAI = &GetAI_npc_daranelle;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_bloodmaul_stout_trigger";
    //pNewScript->GetAI = &GetAI_npc_bloodmaul_stout_trigger;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_simon_game_bunny";
    //pNewScript->GetAI = &GetAI_npc_simon_game_bunny;
    //pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_simon_game_bunny;
    //pNewScript->pEffectScriptEffectNPC = &EffectScriptEffectCreature_npc_simon_game_bunny;
    //pNewScript->RegisterSelf();
}
Exemple #8
0
void AddSC_thousand_needles()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_kanati";
    newscript->GetAI = &GetAI_npc_kanati;
    newscript->pQuestAccept = &QuestAccept_npc_kanati;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_lakota_windsong";
    newscript->GetAI = &GetAI_npc_lakota_windsong;
    newscript->pQuestAccept = &QuestAccept_npc_lakota_windsong;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_paoka_swiftmountain";
    newscript->GetAI = &GetAI_npc_paoka_swiftmountain;
    newscript->pQuestAccept = &QuestAccept_npc_paoka_swiftmountain;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_plucky";
    newscript->GetAI = &GetAI_npc_plucky;
    newscript->pGossipHello =   &GossipHello_npc_plucky;
    newscript->pGossipSelect = &GossipSelect_npc_plucky;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name="npc_enraged_panther";
    newscript->GetAI = &GetAI_npc_enraged_panther;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name="go_panther_cage";
    newscript->pGOHello = &go_panther_cage;
    newscript->RegisterSelf();
}
Exemple #9
0
void AddSC_borean_tundra()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_fizzcrank_fullthrottle";
    newscript->pGossipHello = &GossipHello_npc_fizzcrank_fullthrottle;
    newscript->pGossipSelect = &GossipSelect_npc_fizzcrank_fullthrottle;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_iruk";
    newscript->pGossipHello = &GossipHello_npc_iruk;
    newscript->pGossipSelect = &GossipSelect_npc_iruk;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_kara_thricestar";
    newscript->pGossipHello = &GossipHello_npc_kara_thricestar;
    newscript->pGossipSelect = &GossipSelect_npc_kara_thricestar;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_robot_reprogrammed";
    newscript->pEffectDummyCreature = &EffectDummyCreature_npc_robot_reprogrammed;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_surristrasz";
    newscript->pGossipHello = &GossipHello_npc_surristrasz;
    newscript->pGossipSelect = &GossipSelect_npc_surristrasz;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_tiare";
    newscript->pGossipHello = &GossipHello_npc_tiare;
    newscript->pGossipSelect = &GossipSelect_npc_tiare;
    newscript->RegisterSelf();
}
Exemple #10
0
bool RunScriptLineOnREFR(const char * buf, TESObjectREFR* callingObj, bool bSuppressOutput)
{
	ToggleConsoleOutput(!bSuppressOutput);

	// create a Script object
	UInt8	scriptObjBuf[sizeof(Script)];
	Script	* tempScriptObj = (Script *)scriptObjBuf;

	void	* scriptState = GetGlobalScriptStateObj();

	tempScriptObj->Constructor();
	tempScriptObj->MarkAsTemporary();
	tempScriptObj->SetText(buf);
	bool bResult = tempScriptObj->CompileAndRun(*((void**)scriptState), 1, callingObj);
	tempScriptObj->StaticDestructor();

	ToggleConsoleOutput(true);
	return bResult;
}
Exemple #11
0
void Character::useSpecialOnPoint(int id, int x, int y)
{
    SpecialMap::iterator it = mSpecials.find(id);
    if (!specialUseCheck(it))
            return;
    SpecialValue &special = it->second;

    if (special.specialInfo->target != SpecialManager::TARGET_POINT)
        return;

    //tell script engine to cast the spell
    Script *script = ScriptManager::currentState();
    script->prepare(special.specialInfo->useCallback);
    script->push(this);
    script->push(x);
    script->push(y);
    script->push(special.specialInfo->id);
    script->execute(getMap());
}
Exemple #12
0
void AddSC_the_barrens()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_beaten_corpse";
    newscript->pGossipHello = &GossipHello_npc_beaten_corpse;
    newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_gilthares";
    newscript->GetAI = &GetAI_npc_gilthares;
    newscript->pQuestAccept = &QuestAccept_npc_gilthares;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_sputtervalve";
    newscript->pGossipHello = &GossipHello_npc_sputtervalve;
    newscript->pGossipSelect = &GossipSelect_npc_sputtervalve;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_taskmaster_fizzule";
    newscript->GetAI = &GetAI_npc_taskmaster_fizzule;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_twiggy_flathead";
    newscript->GetAI = &GetAI_npc_twiggy_flathead;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_wizzlecrank_shredder";
    newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI;
    newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder;
    newscript->RegisterSelf();
}
Exemple #13
0
void AddSC_felwood()
{
    Script* pNewScript = new Script;
    pNewScript->Name = "npc_kitten";
    pNewScript->GetAI = &GetAI_npc_kitten;
    pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_kitten;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_corrupt_saber";
    pNewScript->pGossipHello = &GossipHello_npc_corrupt_saber;
    pNewScript->pGossipSelect = &GossipSelect_npc_corrupt_saber;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_niby_the_almighty";
    pNewScript->GetAI = &GetAI_npc_niby_the_almighty;
    pNewScript->pQuestRewardedNPC = &QuestRewarded_npc_niby_the_almighty;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_kroshius";
    pNewScript->GetAI = &GetAI_npc_kroshius;
    pNewScript->pProcessEventId = &ProcessEventId_npc_kroshius;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_captured_arkonarin";
    pNewScript->GetAI = &GetAI_npc_captured_arkonarin;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_captured_arkonarin;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_arei";
    pNewScript->GetAI = &GetAI_npc_arei;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_arei;
    pNewScript->RegisterSelf();
}
void Matrix::cellEdited(int row,int col)
{
Script *script = scriptEnv->newScript(d_table->text(row,col),this,QString("<%1_%2_%3>").arg(name()).arg(row).arg(col));
connect(script, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int)));

script->setInt(row+1, "row");
script->setInt(row+1, "i");
script->setInt(col+1, "col");
script->setInt(col+1, "j");
QVariant ret = script->eval();
if(ret.type()==QVariant::Int || ret.type()==QVariant::UInt || ret.type()==QVariant::LongLong || ret.type()==QVariant::ULongLong)
	d_table->setText(row, col, ret.toString());
else if(ret.canCast(QVariant::Double))
	d_table->setText(row, col, QString::number(ret.toDouble(), txt_format, num_precision));
else
	d_table->setText(row, col, "");

emit modifiedWindow(this);
}
Exemple #15
0
void AddSC_boss_muru()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "boss_muru";
    pNewScript->GetAI = &GetAI_boss_muru;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "boss_entropius";
    pNewScript->GetAI = &GetAI_boss_entropius;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_portal_target";
    pNewScript->GetAI = &GetAI_npc_portal_target;
    pNewScript->RegisterSelf();

#if defined (CLASSIC) || defined (TBC)
    pNewScript = new Script;
    pNewScript->Name = "npc_void_sentinel_summoner";
    pNewScript->GetAI = &GetAI_npc_void_sentinel_summoner;
    pNewScript->RegisterSelf();
#endif
#if defined (WOTLK)
    pNewScript = new Script;
    pNewScript->Name = "npc_darkness";
    pNewScript->GetAI = &GetAI_npc_darkness;
    pNewScript->RegisterSelf();
    
    pNewScript = new Script;
    pNewScript->Name = "npc_singularity";
    pNewScript->GetAI = &GetAI_npc_singularity;
    pNewScript->RegisterSelf();
#endif
}
void AddSC_borean_tundra()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "npc_nesingwary_trapper";
    pNewScript->GetAI = &GetAI_npc_nesingwary_trapper;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_oil_stained_wolf";
    pNewScript->GetAI = &GetAI_npc_oil_stained_wolf;
    pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_oil_stained_wolf;
    pNewScript->pEffectAuraDummy = &EffectAuraDummy_npc_oil_stained_wolf;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_sinkhole_kill_credit";
    pNewScript->GetAI = &GetAI_npc_sinkhole_kill_credit;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_lurgglbr";
    pNewScript->GetAI = &GetAI_npc_lurgglbr;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_lurgglbr;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_beryl_sorcerer";
    pNewScript->pEffectAuraDummy = &EffectAuraDummy_npc_beryl_sorcerer;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_captured_beryl_sorcerer";
    pNewScript->pEffectAuraDummy = &EffectAuraDummy_npc_captured_beryl_sorcerer;
    pNewScript->RegisterSelf();
}
Exemple #17
0
void AddSC_dustwallow_marsh()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "mobs_risen_husk_spirit";
    pNewScript->GetAI = &GetAI_mobs_risen_husk_spirit;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_restless_apparition";
    pNewScript->GetAI = &GetAI_npc_restless_apparition;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_morokk";
    pNewScript->GetAI = &GetAI_npc_morokk;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_morokk;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_ogron";
    pNewScript->GetAI = &GetAI_npc_ogron;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_ogron;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_private_hendel";
    pNewScript->GetAI = &GetAI_npc_private_hendel;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_private_hendel;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "at_nats_landing";
    pNewScript->pAreaTrigger = &AreaTrigger_at_nats_landing;
    pNewScript->RegisterSelf();
}
Exemple #18
0
void AddSC_the_barrens()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "npc_beaten_corpse";
    pNewScript->pGossipHello = &GossipHello_npc_beaten_corpse;
    pNewScript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_gilthares";
    pNewScript->GetAI = &GetAI_npc_gilthares;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_gilthares;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_taskmaster_fizzule";
    pNewScript->GetAI = &GetAI_npc_taskmaster_fizzule;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_twiggy_flathead";
    pNewScript->GetAI = &GetAI_npc_twiggy_flathead;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "at_twiggy_flathead";
    pNewScript->pAreaTrigger = &AreaTrigger_at_twiggy_flathead;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_wizzlecranks_shredder";
    pNewScript->GetAI = &GetAI_npc_wizzlecranks_shredder;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_wizzlecranks_shredder;
    pNewScript->RegisterSelf();
}
Exemple #19
0
void AddSC_silithus()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_highlord_demitrian";
    newscript->pGossipHello =  &GossipHello_npc_highlord_demitrian;
    newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npcs_rutgar_and_frankal";
    newscript->pGossipHello =   &GossipHello_npcs_rutgar_and_frankal;
    newscript->pGossipSelect =  &GossipSelect_npcs_rutgar_and_frankal;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "go_crystalline_tear";
    newscript->pGOHello = &Hello_go_crystalline_tear;
    newscript->pGOQuestAccept = &OnQuestAccept;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "mob_qiraj_war_spawn";
    newscript->GetAI = Getmob_qiraj_war_spawnAI;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_anachronos_quest_trigger";
    newscript->GetAI = Getnpc_anachronos_quest_triggerAI;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_anachronos_the_ancient";
    newscript->GetAI = Getnpc_anachronos_the_ancientAI;
    newscript->RegisterSelf();
}
Exemple #20
0
void AddSC_icecrown()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "npc_arete";
    newscript->pGossipHello = &GossipHello_npc_arete;
    newscript->pGossipSelect = &GossipSelect_npc_arete;
    newscript->RegisterSelf();

	newscript = new Script;
    newscript->Name = "npc_dame_evniki_kapsalis";
    newscript->pGossipHello = &GossipHello_npc_dame_evniki_kapsalis;
    newscript->pGossipSelect = &GossipSelect_npc_dame_evniki_kapsalis;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_squire_david";
    newscript->pGossipHello = &GossipHello_npc_squire_david;
    newscript->pGossipSelect = &GossipSelect_npc_squire_david;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_argent_valiant";
    newscript->GetAI = &GetAI_npc_argent_valiant;
    newscript->RegisterSelf();

	newscript = new Script;
    newscript->Name = "npc_argent_tournament_post";
    newscript->GetAI = &GetAI_npc_argent_tournament_post;
    newscript->RegisterSelf();

	newscript = new Script;
    newscript->Name = "npc_alorah_and_grimmin";
    newscript->GetAI = &GetAI_npc_alorah_and_grimmin;
    newscript->RegisterSelf();
}
void AddSC_blades_edge_mountains()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name = "mobs_bladespire_ogre";
    newscript->GetAI = &GetAI_mobs_bladespire_ogre;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "mobs_nether_drake";
    newscript->GetAI = &GetAI_mobs_nether_drake;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_daranelle";
    newscript->GetAI = &GetAI_npc_daranelle;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_overseer_nuaar";
    newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
    newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_saikkal_the_elder";
    newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
    newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "go_legion_obelisk";
    newscript->pGOHello =           &GOHello_go_legion_obelisk;
    newscript->RegisterSelf();
}
Exemple #22
0
void AddSC_netherstorm()
{
    Script* NewScript;

    NewScript = new Script;
    NewScript->Name = "go_manaforge_control_console";
    NewScript->pGOHello = &GOHello_go_manaforge_control_console;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_manaforge_control_console";
    NewScript->GetAI = &GetAI_npc_manaforge_control_console;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_commander_dawnforge";
    NewScript->GetAI = GetAI_npc_commander_dawnforge;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "at_commander_dawnforge";
    NewScript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_protectorate_nether_drake";
    NewScript->pGossipHello = &GossipHello_npc_protectorate_nether_drake;
    NewScript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_veronia";
    NewScript->pGossipHello = &GossipHello_npc_veronia;
    NewScript->pGossipSelect = &GossipSelect_npc_veronia;
    NewScript->RegisterSelf();
}
Exemple #23
0
//======================================
// Global Functions
//======================================
void FillBehaviorPackageList( void )
{
	Script script;
	const char	*token;
	char  *buf;
	BehaviorPackageType_t *packageType;
	
	// Check if we even HAVE a BehaviorPackages.txt file
	if ( gi.FS_ReadFile( "global/BehaviorPackages.txt", ( void ** )&buf, true ) == -1 )
		return;
	
	script.LoadFile( "global/BehaviorPackages.txt" );
	
	if ( script.length < 0 )
		return;
	
	
	while ( script.TokenAvailable ( true ) )
	{
		token = script.GetToken(false);
		
		if (!Q_stricmp( token , "Package" ) )
		{
			packageType = 0;
			packageType = new BehaviorPackageType_t;
			
			if ( !packageType )
				gi.Error( ERR_FATAL, "FillBehaviorPackageList -- could not create packageType" );
			
			//Set the name and file
			packageType->packageName = script.GetToken(false);
			packageType->stateFile   = script.GetToken(false);
			
			PackageList.AddObject( packageType );
			
		}
		
	}
	
	script.Close();
}
    return new npc_amberpine_woodsmanAI (pCreature);
}

void AddSC_grizzly_hills()
{
    Script* newscript;

    newscript = new Script;
    newscript->Name = "npc_orsonn_and_kodian";
    newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian;
    newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_emily";
    newscript->GetAI = &GetAI_npc_emily;
    newscript->pQuestAccept = &QuestAccept_npc_emily;
    newscript->RegisterSelf();
    
    newscript = new Script;
    newscript->Name = "npc_mrfloppy";
    newscript->GetAI = &GetAI_npc_mrfloppy;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_outhouse_bunny";
    newscript->GetAI = &GetAI_npc_outhouse_bunny;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_tallhorn_stag";
    newscript->GetAI = &GetAI_npc_tallhorn_stag;
    newscript->RegisterSelf();

    newscript = new Script;
    newscript->Name = "npc_amberpine_woodsman";
void AddSC_trial_of_the_crussader()
{
    Script* NewScript;

    NewScript = new Script;
    NewScript->Name = "npc_tcrus_announcer";
        NewScript->GetAI = &GetAI_npc_tcrus_announcer;
    NewScript->pGossipHello = &GossipHello_npc_tcrus_announcer;
    NewScript->pGossipSelect = &GossipSelect_npc_tcrus_announcer;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_tcrus_tirion";
        NewScript->GetAI = &GetAI_npc_tcrus_tirion;
    NewScript->RegisterSelf();

    NewScript = new Script;
    NewScript->Name = "npc_tcrus_fizzlebang";
        NewScript->GetAI = &GetAI_npc_tcrus_fizzlebang;
    NewScript->RegisterSelf();

        NewScript = new Script;
    NewScript->Name = "npc_Garrosh";
        NewScript->GetAI = &GetAI_npc_Garrosh;
    NewScript->RegisterSelf();

        NewScript = new Script;
    NewScript->Name = "npc_LichKing";
        NewScript->GetAI = &GetAI_npc_LichKing;
    NewScript->RegisterSelf();

        NewScript = new Script;
    NewScript->Name = "npc_KingVyrn";
        NewScript->GetAI = &GetAI_npc_KingVyrn;
    NewScript->RegisterSelf();
}
void Matrix::cellEdited(int row,int col)
{
	QString cell_text = text(row,col);
	if(cell_text.isEmpty()) return;

	QString cell_formula = cell_text;

	bool ok = true;
    QLocale locale;
  	double res = locale.toDouble(cell_text, &ok);
	if (ok)
		setText(row, col, locale.toString(res, txt_format.toAscii(), num_precision));
	else
	{
		Script *script = scriptEnv->newScript(cell_formula, this, QString("<%1_%2_%3>").arg(name()).arg(row).arg(col));
		connect(script, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int)));

		script->setInt(row+1, "row");
		script->setInt(row+1, "i");
		script->setInt(col+1, "col");
		script->setInt(col+1, "j");

		QVariant ret = script->eval();
		if(ret.type()==QVariant::Int || ret.type()==QVariant::UInt || ret.type()==QVariant::LongLong
				|| ret.type()==QVariant::ULongLong)
			setText(row, col, ret.toString());
		else if(ret.canConvert(QVariant::Double))
			setText(row, col, locale.toString(ret.toDouble(), txt_format.toAscii(), num_precision));
		else
			setText(row, col, "");
	}

    if(row+1 >= numRows())
        d_table->setRowCount(row + 2);

	d_table->setCurrentCell(row+1, col);

	if(allow_modification_signals)
		emit modifiedWindow(this);
}
void AddSC_bosses_emerald_dragons()
{
    Script* s;
    s = new boss_emeriss();
    s->RegisterSelf();
    s = new boss_lethon();
    s->RegisterSelf();
    s = new npc_spirit_shade();
    s->RegisterSelf();
    s = new boss_taerar();
    s->RegisterSelf();
    s = new boss_ysondre();
    s->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "boss_emeriss";
    //pNewScript->GetAI = &GetAI_boss_emeriss;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "boss_lethon";
    //pNewScript->GetAI = &GetAI_boss_lethon;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "npc_spirit_shade";
    //pNewScript->GetAI = &GetAI_npc_spirit_shade;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "boss_taerar";
    //pNewScript->GetAI = &GetAI_boss_taerar;
    //pNewScript->RegisterSelf();

    //pNewScript = new Script;
    //pNewScript->Name = "boss_ysondre";
    //pNewScript->GetAI = &GetAI_boss_ysondre;
    //pNewScript->RegisterSelf();
}
void AddSC_stormwind_city()
{
    Script* pNewScript;

    pNewScript = new Script;
    pNewScript->Name = "npc_bartleby";
    pNewScript->GetAI = &GetAI_npc_bartleby;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_bartleby;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_dashel_stonefist";
    pNewScript->GetAI = &GetAI_npc_dashel_stonefist;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_dashel_stonefist;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_lady_katrana_prestor";
    pNewScript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
    pNewScript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_squire_rowe";
    pNewScript->GetAI = &GetAI_npc_squire_rowe;
    pNewScript->pGossipHello = &GossipHello_npc_squire_rowe;
    pNewScript->pGossipSelect = &GossipSelect_npc_squire_rowe;
    pNewScript->RegisterSelf();

    pNewScript = new Script;
    pNewScript->Name = "npc_reginald_windsor";
    pNewScript->GetAI = &GetAI_npc_reginald_windsor;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_reginald_windsor;
    pNewScript->pGossipHello = &GossipHello_npc_reginald_windsor;
    pNewScript->pGossipSelect = &GossipSelect_npc_reginald_windsor;
    pNewScript->RegisterSelf();
}
  //
  // SaveState
  //
  // Save state information
  //
  void Script::Manager::SaveState(FScope *scope)
  {
    // Save the recruit id
    StdSave::TypeU32(scope, "RecruitId", recruitId);

    // Save each script
    for (NBinTree<Script>::Iterator s(&scripts); *s; s++)
    {
      // Get the script
      Script *script = *s;

      // Create the scope
      FScope *sScope = scope->AddFunction("Script");

      // Add construction data as arguments
      sScope->AddArgString(script->GetName());
      sScope->AddArgString(script->GetConfigName());
      sScope->AddArgInteger(script->GetWeighting());
      sScope->AddArgInteger(script->GetPriority());

      // Save the script state data
      script->SaveState(sScope);
    }
  }
Exemple #30
0
int Monster::damage(Actor *source, const Damage &damage)
{
    int HPLoss = Being::damage(source, damage);
    if (source)
    {
        changeAnger(source, HPLoss);
    }

    if (HPLoss && source && source->getType() == OBJECT_CHARACTER)
    {
        Character *s = static_cast< Character * >(source);

        mExpReceivers[s].insert(damage.skill);
        if (mKillStealProtectedTimeout.expired() || mOwner == s
            || mOwner->getParty() == s->getParty())
        {
            mOwner = s;
            mLegalExpReceivers.insert(s);
            mKillStealProtectedTimeout.set(KILLSTEAL_PROTECTION_TIME);
        }
    }

    if (mSpecy->getDamageCallback().isValid())
    {
        Script *script = ScriptManager::currentState();
        script->setMap(getMap());
        script->prepare(mSpecy->getDamageCallback());
        script->push(this);
        script->push(source);
        script->push(HPLoss);
        // TODO: add exact damage parameters as well
        script->execute();
    }

    return HPLoss;
}