Les Vaux

Forum dédié au mod
 
AccueilPortailCalendrierGalerieFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 OnActivateItem

Aller en bas 
AuteurMessage
Admin
Cerbère
Cerbère
avatar

Nombre de messages : 156
Date d'inscription : 07/10/2006

MessageSujet: OnActivateItem   Mar 14 Aoû 2007 - 13:30

//::///////////////////////////////////////////////
//:: Example XP2 OnActivate Script Script
//:: x2_mod_def_act
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnItemActivate Event

*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////

#include "x2_inc_switches"
//pour les chevaux
#include "zep_inc_phenos"
//pour l'artisanat
#include "cnr_recipe_utils"
void main()
{
object oItem = GetItemActivated();
//pour les divinites
ExecuteScript( "it_" + GetTag( GetItemActivated() ), GetItemActivator() );
//partie CNR
object oActivator = GetItemActivator();
//partie chevaux
location lActivator = GetLocation(oActivator);
string sItemTag = GetTag(oItem);
location lTarget = GetItemActivatedTargetLocation();
ExecuteScript("tendril_activate", OBJECT_SELF);
//ExecuteScript(GetTag(GetItemActivated()), OBJECT_SELF);
ExecuteScript("cr_onact", GetItemActivator());
ExecuteScript("cr_transf_onactv", GetItemActivator());
ExecuteScript("gsc_oai",OBJECT_SELF); //Ridable Horses


if (sItemTag == "RB_DiceBag")
{
ExecuteScript("rbdicebag", OBJECT_SELF);
return;
}

if (sItemTag == "DM_BubbleUnderWater")
{
ExecuteScript("bubble_lever3", OBJECT_SELF);
return;
}

if (sItemTag == "flying_disc")
{
ExecuteScript("flying_disc1", OBJECT_SELF);
return;
}

if (sItemTag == "_f_act_of_god_2")
{
ExecuteScript("_f_act_of_god_", OBJECT_SELF);
return;
}

if (sItemTag == "j_news_paper2")
{
ExecuteScript("j_news_paper", OBJECT_SELF);
return;
}

if (sItemTag == "DMEncounterWidget2")
{
ExecuteScript("dmencounterwidge", OBJECT_SELF);
return;
}

if (sItemTag == "DyeKit")
{
ExecuteScript("dye_kit_onact", OBJECT_SELF);
return;
}

if (sItemTag == "AnimalCompanionPanda")
{
ExecuteScript("ac_2panda", OBJECT_SELF);
return;
}

if (sItemTag == "AnimalCompanionTiger")
{
ExecuteScript("panther_wtiger", OBJECT_SELF);
return;
}

if (sItemTag == "Ranger_Tracking2")
{
ExecuteScript("ranger_tracking", OBJECT_SELF);
return;
}

if (sItemTag == "wolfmorph2")
{
ExecuteScript("wolfmorph", OBJECT_SELF);
return;
}

if (sItemTag == "item_flyto_261")
{
ExecuteScript("item_flyto", OBJECT_SELF);
return;
}

if (sItemTag == "BigBoomMaker")
{
ExecuteScript("boom_barrelmake", OBJECT_SELF);
return;
}

if (sItemTag == "g_firework_wand")
{
ExecuteScript("g_missile", oActivator);
return;
}

if (sItemTag == "bookofkehaar")
{
ExecuteScript("bookofkehaar2", oActivator);
return;
}

if (sItemTag == "nss_sc_chair1")
{
ExecuteScript("nss_on_activate", OBJECT_SELF);
return;
}

if (sItemTag == "nss_sc_tent")
{
ExecuteScript("nss_on_activate", OBJECT_SELF);
return;
}

if (sItemTag == "nss_sc_chair2")
{
ExecuteScript("nss_on_activate", OBJECT_SELF);
return;
}

if (sItemTag == "nss_sc_bed1")
{
ExecuteScript("nss_on_activate", OBJECT_SELF);
return;
}

if (sItemTag == "StoneSkin")
{
ExecuteScript("cleric_stonghost", OBJECT_SELF);
return;
}

if (sItemTag == "PortalScroll")
{
ExecuteScript("bee_tp_onact", OBJECT_SELF);
return;
}

if (sItemTag == "DragonSlayer")
{
ExecuteScript("dgn_slayer_drink", OBJECT_SELF);
return;
}

if (sItemTag == "rq_view_pc")
{
ExecuteScript("rq_view_pc2", OBJECT_SELF);
return;
}

if (sItemTag == "Ox_Rope")
{
ExecuteScript("Ox_Rope2", OBJECT_SELF);
return;
}

if (sItemTag == "Tar")
{
ExecuteScript("bardsongonact", OBJECT_SELF);
return;
}

if (sItemTag == "Harp")
{
ExecuteScript("bardsongonact", OBJECT_SELF);
return;
}

if (sItemTag == "Lute")
{
ExecuteScript("bardsongonact", OBJECT_SELF);
return;
}

if (sItemTag == "Horn")
{
ExecuteScript("bardsongonact", OBJECT_SELF);
return;
}

if (sItemTag == "Pipes")
{
ExecuteScript("bardsongonact", OBJECT_SELF);
return;
}

if (sItemTag == "townportal")
{
ExecuteScript("_townportal", OBJECT_SELF);
return;
}

if (sItemTag == "TomsShieldThingie")
{
ExecuteScript("shield_spell", OBJECT_SELF);
return;
}

if (GetTag(oItem) == "PCList")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "c_pcl_activate", TRUE));
return;
}

if (GetTag(oItem) == "Emote2")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "mod_emote", TRUE));
return;
}

if (GetTag(oItem) == "DruidWeatherControl")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "make_weather", TRUE));
return;
}

if (GetTag(oItem) == "DMCreator")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "wand_convo", TRUE));
return;
}

if (GetTag(oItem) == "BardsTool")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_bard_perform", TRUE));
return;
}


if (GetTag(oItem) == "PolymorphTool")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_presto_chango", TRUE));
return;
}

if (GetTag(oItem) == "ScryingMagic")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "scry_talk", TRUE));
return;
}
if (GetTag(oItem) == "rlyeh_text")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_rilith_talk", TRUE));
return;
}
if (GetTag(oItem) == "kindling001")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_campfire", TRUE));
return;
}
if (GetTag(oItem) == "Necronomicon")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_necromonium_tal", TRUE));
return;
}
if (GetTag(oItem) == "MapofArkham")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_map_talk", TRUE));
return;
}

if (GetTag(oItem) == "Annakol_Map")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_map_talk", TRUE));
return;
}

if (GetTag(oItem) == "MapofShadowoodForest")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_map_talk", TRUE));
return;
}

if (GetTag(oItem) == "Pixie_Widget")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_pixie", TRUE));
return;
}

if (GetTag(oItem) == "MapoftheManuxetBluffs")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "_map_talk", TRUE));
return;
}

if (sItemTag == "StrippersPinRed")
{
ExecuteScript("_striptease_", oActivator);
return;
}

if (sItemTag == "StrippersPinBlue")
{
ExecuteScript("_striptease_blue", oActivator);
return;
}

if (sItemTag == "SummonKitty")
{
ExecuteScript("hench_kitty", OBJECT_SELF);
return;
}

if (sItemTag == "summon_penguin")
{
ExecuteScript("hench_penguin", OBJECT_SELF);
return;
}

if (sItemTag == "summon_Calf")
{
ExecuteScript("hench_calf", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_FairyDragon")
{
ExecuteScript("hench_fdragon", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_Scimitar")
{
ExecuteScript("hench_sword", OBJECT_SELF);
return;
}

if (sItemTag == "Summonpanther")
{
ExecuteScript("hench_zula", OBJECT_SELF);
return;
}

if (sItemTag == "Summonhound")
{
ExecuteScript("hench_faford", OBJECT_SELF);
return;
}

if (sItemTag == "summon_puppy")
{
ExecuteScript("hench_puppy", OBJECT_SELF);
return;
}

if (sItemTag == "summon_bear")
{
ExecuteScript("hench_bear", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_zepher")
{
ExecuteScript("hench_zepher", OBJECT_SELF);
return;
}

if (sItemTag == "summon_snake")
{
ExecuteScript("hench_snake", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_dalmati")
{
ExecuteScript("hench_dalmation", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_Pig")
{
ExecuteScript("hench_pig", OBJECT_SELF);
return;
}

if (sItemTag == "Summon_Dog")
{
ExecuteScript("hench_dog", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse")
{
ExecuteScript("hench_pony", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse2")
{
ExecuteScript("hench_pony2", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse3")
{
ExecuteScript("hench_pony3", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse4")
{
ExecuteScript("hench_pony4", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse5")
{
ExecuteScript("hench_pony5", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse6")
{
ExecuteScript("hench_pony6", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse7")
{
ExecuteScript("hench_pony7", OBJECT_SELF);
return;
}

if (sItemTag == "SummonHorse8")
{
ExecuteScript("hench_pony8", OBJECT_SELF);
return;
}

if (sItemTag == "horse_dismt")
{
object oPC = GetItemActivator();
if (GetTag (GetItemActivated ()) == "horse_dismt") {zep_Dismount (oPC, "horse_dismt");}
return;
}

if (GetTag(oItem) == "Horse_Management")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "horse_magmt", TRUE));
return;
}

if (sItemTag == "Summon_Skunk2")
{
ExecuteScript("hench_skunk", OBJECT_SELF);
return;
}

if (sItemTag == "SummonWyrmling")
{
ExecuteScript("hench_wyrmling", OBJECT_SELF);
return;
}

if (sItemTag == "TsFishingBait")
{
ExecuteScript("ts_fishing", oItem);
return;
}

if (sItemTag == "ModuleReloader")
{
StartNewModule(GetModuleName());
return;
}

ExecuteScript(sItemTag, OBJECT_SELF);
//partie CNR
if (CnrRecipeBookOnActivateItem(oItem, oActivator))
{
return;
}

if (CnrJournalOnActivateItem(oItem, oActivator))
{
return;
}
// * Generic Item Script Execution Code
// * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// * it will execute a script that has the same name as the item's tag
// * inside this script you can manage scripts for all events by checking against
// * GetUserDefinedItemEventNumber(). See x2_it_example.nss
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}

}

}
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://nwn2-lesvaux.easyforumpro.com
 
OnActivateItem
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Les Vaux :: Espace conception :: Aide au scriptage-
Sauter vers: