PWE_PRC8/_module/nss/ff_on_activate.nss

48 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 10:29:41 -04:00
///*************************************
//* NWN-MySQL 4.0 (c) 2004 FastFrench *
//*************************************
// This file is licensed under the terms of the
// GNU GENERAL PUBLIC LICENSE (GPL) Version 2
// ************************
// ** ff_on_activate.nss **
// ************************
// ** use this script on your OnActivate module event
// ** (or add the instruction:
// ** ExecuteScript("ff_on_activate", OBJECT_SELF);
// ** at the beginning of your main function in your existing script
#include "ff_include"
void main()
{
if (!FF_USE_EXTERNAL_DATABASE) return;
object oItem = GetItemActivated(); // get the item activated
string sItemTag = GetTag(oItem); // and its tag
string sItemName = GetName(oItem); // and its name
object oActivator = GetItemActivator(); // get the wand's activator
if (sItemName=="Un parchemin tr<74>s fragile")
{
int NoIndice = StringToInt(sItemTag);
string sMsg;
if (NoIndice<=0)
sMsg = "Celui qui a d<>pos<6F> cet objet l<> est un <20>ne qui n'a rien compris dans toute la subtilit<69> autour de sa mise en oeuvre !";
sMsg = ff_GetPersistentString("IndiceNo"+IntToString(NoIndice),"global", "... (pas de chance, vous ne parvenez pas a dechiffrer le message)...");
pwWriteLog(oActivator, "LECTURE", "INDICE", "'"+GetName(oActivator)+"' lit l'indice No "+IntToString(NoIndice)+": '"+sMsg+"'");
SendMessageToPC(oActivator, ff_Colorize("[db]Vous d<>roulez soigneusement le parchemin qui se d<>sagr<67>ge alors que vous le lisez:\n[w]"+ sMsg));
FloatingTextStringOnCreature(ff_Colorize("[b]"+GetName(oActivator)+" d<>roule soigneusement le parchemin qui se d<>sagr<67>ge sous vos yeux pendant qu'il le lit: '[w]"+sMsg+"[b]'[y]"), oActivator, TRUE);
SQLExecDirect("DELETE FROM global WHERE VarName='IndiceNo"+IntToString(NoIndice)+"'");
DestroyObject(oItem);
return;
}
if (sItemTag=="FastFrenchwand")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "ff_serverstat", TRUE, FALSE));
return;
}
}