okay merging seems to be an issue for me (probably because I am doing something wrong here XD) But I just implemented the guild quest system for my module/pw and I get an error on the last on_client_enter script:
#include "da_includefile_1"#include "dmfi_init_inc"#include "sha_subr_methds"#include "persistance"// If your module's OnClientEnter has custom scripting, just paste the following into it.// Be sure to include the file "da_includefile_1" at the very top, as it is here.int nQuest;int nQuestState;object oPassport;object oPC;void main(){{// find who just enteredoPC = GetEnteringObject();// if they don't have a guild book, give them oneif(GetItemByName("Guild Book", oPC) == OBJECT_INVALID)CreateItemOnObject("guildbook", oPC);// find the Passport object in the PC's inventoryoPassport = GetItemByName("Passport", oPC);// if the PC has no passport, give them oneif(oPassport == OBJECT_INVALID)oPassport = CreateItemOnObject("passport", oPC);// restore the journal from the quest// states stored on the passport's tag// NOTE - the quest tags must be named// in the format "1" for the first quest on the// passport tag, "2" for the second, etc.// loop through the passport tag, updating the journalfor (nQuest = 1; nQuest < 32; nQuest++){// get the existing quest statenQuestState = GetTagData(oPassport, nQuest);// if it's not zero, update the journalif(nQuestState != 0)AddJournalQuestEntry(IntToString(nQuest), nQuestState, oPC, FALSE, FALSE, TRUE);}// add the "message of the day" journal entry// (this also makes sure that the last "journal sound"// heard by the PC is the "ding" instead of the music)AddJournalQuestEntry("Message", 1, oPC, FALSE, FALSE, TRUE);// re-set the button for quests// SetPanelButtonFlash(oPC, PANEL_BUTTON_JOURNAL, FALSE);}SetLocalInt(GetEnteringObject(), "nRestingCounterPC", 100); // (100) number of rounds between rest must be same as on OnModRestint iPUNISHMENT = TRUE; //Change this to FALSE to turn *off* the module's auto-punishment for criminals who try to log off and on again to evade punishment.object DA_oMODULE = GetModule();object DA_oPC = GetEnteringObject();object DA_oAREA = GetArea(DA_oPC);object DA_oPITMASTER = GetObjectByTag("da_pitmaster");object DA_oPIT = GetArea(DA_oPITMASTER);object DA_oWP_ENTRANCE = GetWaypointByTag("da_wp_entrance");int iENFORCER = GetIsEnforcer(DA_oPC);int iEXEMPT = GetIsExempt(DA_oPC);string DA_sNAME = GetName(DA_oPC);string DA_sUSERID = GetPCPlayerName(DA_oPC);DeleteLocalInt(DA_oPC, "da_slot");DeleteLocalInt(DA_oPC, "da_Team");if (iENFORCER == TRUE) //Place an Enforcer Key in the inventory of every Enforcer who doesn't yet have one.{int iHASKEY = FALSE;string sKEY = "da_enforcerkey";object oITEM = GetFirstItemInInventory(DA_oPC);while (GetIsObjectValid(oITEM)){string sITEM = GetTag(oITEM);string sITEMLEFT14 = GetStringLeft(sITEM, 14);if (sITEMLEFT14 == sKEY)iHASKEY = TRUE;oITEM = GetNextItemInInventory(DA_oPC);}if (iHASKEY == FALSE){CreateItemOnObject("da_enforcerkey", DA_oPC);SendMessageToPC(DA_oPC, "You might find this item useful; please hold on to it.");}}else //Destroy all Enforcer Keys in the inventory of non-authorized enforcers.{string sKEY = "da_enforcerkey";object oITEM = GetFirstItemInInventory(DA_oPC);while (GetIsObjectValid(oITEM)){string sITEM = GetTag(oITEM);string sITEMLEFT14 = GetStringLeft(sITEM, 14);if (sITEMLEFT14 == sKEY){DestroyObject(oITEM);SendMessageToPC(DA_oPC, "You are not authorized to carry an Enforcer Key; it has been destroyed.");}oITEM = GetNextItemInInventory(DA_oPC);}}if (iEXEMPT == TRUE)DeleteLocalInt(DA_oMODULE, "da_" + DA_sNAME + DA_sUSERID); //Make sure no exempt player is counted as punishable.int iJAIL = GetLocalInt(DA_oMODULE, "da_" + DA_sNAME + DA_sUSERID);if (iJAIL == TRUE && iPUNISHMENT == TRUE){int iPRIORXP = GetXP(DA_oPC);int iXPHIT = iPRIORXP/10;int iPOSTXP = iPRIORXP - iXPHIT; //Take 10% of the criminal's XP.SetXP(DA_oPC,iPOSTXP); //Default punishment is 5%; the other 5% is for logging off and on again.object oITEM = GetFirstItemInInventory(DA_oPC);while (GetIsObjectValid(oITEM)){DestroyObject(oITEM); //Destroy all items in the criminal's inventory.oITEM = GetNextItemInInventory(DA_oPC);}oITEM = GetItemInSlot(INVENTORY_SLOT_ARMS, DA_oPC); //Destroy all equipped items.if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_ARROWS, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_BELT, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_BOLTS, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_BOOTS ,DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_BULLETS, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_CHEST, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_CLOAK,DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_HEAD,DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_LEFTRING, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_NECK, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);oITEM = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, DA_oPC);if (GetIsObjectValid(oITEM))DestroyObject(oITEM);int iGP = GetGold(DA_oPC);AssignCommand(DA_oPC, TakeGoldFromCreature(iGP, DA_oPC, TRUE)); //Take the criminal's gold.object oGARB = CreateItemOnObject("da_prsngrb", DA_oPC); //Make the criminal don prison garb.DelayCommand(0.1, AssignCommand(DA_oPC, ActionEquipItem(oGARB, INVENTORY_SLOT_CHEST)));DelayCommand(10.0, FloatingTextStringOnCreature("You're still a criminal; leaving & coming back won't help.", DA_oPC, FALSE)); //Verbal reprimand.}object oUser = GetEnteringObject();// do any other module OnClientEnter work hereExecuteScript("x3_mod_def_enter", OBJECT_SELF);// initialize DMFIdmfiInitialize(oUser);SubraceOnClientEnter();}// find who just enteredoPC = GetEnteringObject();// if they don't have a guild book, give them oneif(GetItemByName("Guild Book", oPC) == OBJECT_INVALID)CreateItemOnObject("guildbook", oPC);// find the Passport object in the PC's inventoryoPassport = GetItemByName("Passport", oPC);// if the PC has no passport, give them oneif(oPassport == OBJECT_INVALID)oPassport = CreateItemOnObject("passport", oPC);// restore the journal from the quest// states stored on the passport's tag// NOTE - the quest tags must be named// in the format "1" for the first quest on the// passport tag, "2" for the second, etc.// loop through the passport tag, updating the journalfor (nQuest = 1; nQuest < 32; nQuest++){// get the existing quest statenQuestState = GetTagData(oPassport, nQuest);// if it's not zero, update the journalif(nQuestState != 0)AddJournalQuestEntry(IntToString(nQuest), nQuestState, oPC, FALSE, FALSE, TRUE);}// add the "message of the day" journal entry// (this also makes sure that the last "journal sound"// heard by the PC is the "ding" instead of the music)AddJournalQuestEntry("Message", 1, oPC, FALSE, FALSE, TRUE);// re-set the button for quests// SetPanelButtonFlash(oPC, PANEL_BUTTON_JOURNAL, FALSE);}}





Retour en haut







