Questions regarding my server

User avatar
Signature
Posts: 126
Joined: Fri May 02, 2014 3:44 am

Re: Questions regarding my server

Post by Signature » Mon Jun 02, 2014 4:56 pm

kjLotus wrote:
i did :) just can't unlock them

Sure you can.... @addspell 306 and @addspell 305 :P

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Questions regarding my server

Post by kjLotus » Mon Jun 02, 2014 5:14 pm

Signature wrote:
kjLotus wrote:
i did :) just can't unlock them

Sure you can.... @addspell 306 and @addspell 305 :P
can't unlock the normal way*

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Mon Jun 02, 2014 5:32 pm

Thanks for your messages guys. Guess i should find some website to learn some LUA basics and start from there and also use your make a question and make a mission wiki.

As for Odin, he said that it was working and wanted to organize an event for the server's players to kill it, so the instance might not be working but he somehow managed to implement the monster. And since Odin is not at all in your mob list, how did he do that ?

I mean... i dont mind learning, taking my time to try and fix some stuff, but there is one thing that i dont get. I have no retail access, so i cant sniff packet or whatever. Now, if a mob like Odin is not in game and not implemented by Darkstar, how do you actually add id ?

If an area like Hazham Hunting Ground is not working when i warp to it as a GM and end up in a mog house, how can you actually make an area work ?

(edit for above part : instead of warping directly to Hazhalm as a GM, i've teleported myself to caedarva mire and walked to hazhalm and could get into the area, however, since i do not know Odin's ID as its not listed, i cant make it pop. How do you actually add an unlisted NM/HNM ? I know you'd have to add its value to https://raw.githubusercontent.com/Darks ... points.sql, but how do you actually get its value in the first place?)

In fact, i can understand that writing a script for an NPC to give you a keyitem, trigger a cutscene and move onto the next mission is doable as its scripted and if you do it well, you can just make all missions work again. But things that are not in game such as events, monsters or area, how can you actually add that ? I dont think I'd understand the process but i am curious to know how you guys are doing that ! Even if i dont get it know, i can come back later on the forum and read it anyway so it might be useful.

In the mean time, i will try to learn some LUA !

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Thu Jun 05, 2014 5:17 am

Working on WOTG Mission 2 in Garlaige Citadel [S].

If you talk to Randecque, you're supposed to get a keyitem : red recommendation letter.

Since i had no idea how to proceed, i've checked a similar script of a npc providing a keyitem if you talk to it and did some modifications :
-----------------------------------
-- Area: Garlaige Citadel [S]
-- NPC: Randecque
-- Involved in Mission: BACK TO THE BEGINNING
-- @zone 164
-- @pos -26.824 3.601 -137.082
-----------------------------------
package.loaded["scripts/zones/Garlaige_Citadel_[S]/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/keyitems");
require("scripts/zones/Garlaige_Citadel_[S]/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

if(player:getCurrentMission(WOTG) == BACK_TO_THE_BEGINNING) then
player:startEvent(0x0072);
elseif(player:getCurrentMission(WOTG) == CAIT_SITH) then
player:startEvent(0x0073);
else
player:startEvent(0x0071);
end

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);

if(csid == 0x0001) then
player:addKeyItem(RED_RECOMMENDATION_LETTER);
player:messageSpecial(KEYITEM_OBTAINED,RED_RECOMMENDATION_LETTER);
player:setVar("RedRecommendationLetter",0);
end

end;
The original script is here :
-----------------------------------
-- Area: Kazham
-- NPC: Jakoh Wahcondalo
-- @pos 101 -16 -115 250
-----------------------------------
package.loaded["scripts/zones/Kazham/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/missions");
require("scripts/zones/Kazham/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

if(player:getCurrentMission(ZILART) == KAZAMS_CHIEFTAINESS) then
player:startEvent(0x0072);
elseif(player:getCurrentMission(ZILART) == THE_TEMPLE_OF_UGGALEPIH) then
player:startEvent(0x0073);
elseif(player:getCurrentMission(WINDURST) == AWAKENING_OF_THE_GODS and player:getVar("MissionStatus") == 2) then
player:startEvent(0x0109);
else
player:startEvent(0x0071);
end

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);

if(csid == 0x0072) then
player:addKeyItem(SACRIFICIAL_CHAMBER_KEY);
player:messageSpecial(KEYITEM_OBTAINED,SACRIFICIAL_CHAMBER_KEY);
player:completeMission(ZILART,KAZAMS_CHIEFTAINESS);
player:addMission(ZILART,THE_TEMPLE_OF_UGGALEPIH);
end

end;
I have some problems tho. Right now, if i talk to Randecque, instead of not reacting at all, it triggers something but nothing happen, no cutscene, no dialog, no keyitem rewarded, its like a freeze and i have to @release to get away.

It might be caused by a lack of information in my script. Here is what i am missing :
- @pos

I dont know the NPC POS.

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

if(player:getCurrentMission(WOTG) == BACK_TO_THE_BEGINNING) then
player:startEvent(0x0001);
elseif(player:getCurrentMission(WOTG) == CAIT_SITH) then
player:startEvent(0x0002);
else
player:startEvent(0x0003);
end

end;

I dont know what to put into the StartEvent part. I mean... the cs showing the npc talking to you and saying that he's gonna hand out the recommendation later happen if you use @cs 1 at Garlaige Citadel [S]. Tried to do a decimal to hexadecimal but 1 = 1... So i thought it'd be 0x0001 but am i correct ?

I've randomly used 0002 and 0003 in the elseif part because i dont know the cs right now, but will try to figure it out. Can someone tell me how to go from @cs 1 to startEvent(0x.....) ?

if(csid == 0x0001) then
player:addKeyItem(RED_RECOMMENDATION_LETTER);
player:messageSpecial(KEYITEM_OBTAINED,RED_RECOMMENDATION_LETTER);
player:setVar("RedRecommendationLetter",0);

Not sure if you actually have to write RED_RECOMMENDATION_LETTER for Red Recommendation Letter... or if i am mistaken.

And then again (csid == 0x0001) is correct ? Or i am doing something wrong again ?
Really trying to figure this out, but i have to say this is brainwashing haha...

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Thu Jun 05, 2014 5:26 am

Nevermind... seems like i somehow got it down (partially) :

Image

However, it doesn't matter how many times i talk to him, the same cutscene trigger and i always get the keyitem multiple times even tho i've set this :
-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

if(player:getCurrentMission(WOTG) == BACK_TO_THE_BEGINNING) then
player:startEvent(0x0001);
elseif(player:getCurrentMission(WOTG) == CAIT_SITH) then
player:startEvent(0x0002);
else
player:startEvent(0x0003);
end

end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);

if(csid == 0x0001) then
player:addKeyItem(RED_RECOMMENDATION_LETTER);
player:messageSpecial(KEYITEM_OBTAINED,RED_RECOMMENDATION_LETTER);
player:setVar("RedRecommendationLetter",0);
end

end;
Is there a scripting line i have to add so the npc do not give me the keyitem over and over again if i already have it ?

How to trigger another cutscene if i do have it and how to avoid receiving it multiple times ? I am not so sure about this part :/

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Thu Jun 05, 2014 6:26 am

I've tried but it doesn't matter, its still starting the same cutscene and the npc is always giving me the same keyitem over and over again even if i set it to 1...

If i already have the keyitem i'd rather have it trigger another cutscene which says something else and having the npc not giving it out again since it doesn't make sense lol.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Questions regarding my server

Post by TeoTwawki » Thu Jun 05, 2014 8:04 am

This is how I currently have mine setup.

Code: Select all

-----------------------------------
--  Area: Garlaige Citadel [S]
--  NPC: Randecque
--  @zone 164
--  @pos 61 -6 137
--  Notes: Gives Red Letter required to start "Starts Steamed Rams"
-----------------------------------
package.loaded["scripts/zones/Garlaige_Citadel_[S]/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/Garlaige_Citadel_[S]/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
    if (player:getVar("Used_RED_RECOMMENDATION_LETTER") == 1) then
        player:startEvent(0x0003);
    elseif (player:hasKeyItem(RED_RECOMMENDATION_LETTER) == false) then
        player:startEvent(0x0001);
    elseif (player:hasKeyItem(RED_RECOMMENDATION_LETTER) == true) then
        player:startEvent(0x0002);
    end

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);

    if(csid == 0x0001 and option == 0) then
        player:addKeyItem(RED_RECOMMENDATION_LETTER);
        player:messageSpecial(KEYITEM_OBTAINED,RED_RECOMMENDATION_LETTER);
    end

end;
And here is where I am setting that var, because I was pretty sure nothing tracks a players campaign allegiance yet.

Code: Select all

-----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Mainchelite
-- @zone 80
-- @pos -16 1 -30
-----------------------------------
package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/titles");
require("scripts/globals/quests");
require("scripts/globals/missions");
require("scripts/zones/Southern_San_dOria_[S]/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
-- 0x005 = Generic Greeting for Iron Ram members
-- 0x006 = Mid Initiation of other nation
-- 0x007 = Ask player to Join Iron Rams
-- 0x008 = Ask if changed mind about joining Iron rams (after player has declined)
-- 0x009 = Mid Initiation of other nation
-- 0x00A = Player works for another nation, offer to switch +give quest
-- 0x00B = Player works for another nation, offer to switch +give quest
-- 0x00C = Complete investigation
-- 0x00D = "How fares the search, <player>?"
-- 0x00E = "How fares the search, <player>?"
-- 0x00F = No Red Recommendation Letter and has no nation affiliation
    local TheFightingFourth = player:getQuestStatus(CRYSTAL_WAR,THE_FIGHTING_FOURTH);
    local SnakeOnThePlains = player:getQuestStatus(CRYSTAL_WAR,SNAKE_ON_THE_PLAINS);
    local SteamedRams = player:getQuestStatus(CRYSTAL_WAR,STEAMED_RAMS);
    local RedLetter = player:hasKeyItem(RED_RECOMMENDATION_LETTER);
    local CharredPropeller = player:hasKeyItem(CHARRED_PROPELLER);
    local OxidizedPlate = player:hasKeyItem(OXIDIZED_PLATE);
    local ShatteredLumber = player:hasKeyItem(PIECE_OF_SHATTERED_LUMBER);

    if (TheFightingFourth == QUEST_ACCEPTED or SnakeOnThePlains == QUEST_ACCEPTED) then
        player:startEvent(0x009);
    elseif (SteamedRams == QUEST_AVAILABLE and RedLetter == true) then
        player:startEvent(0x007);
    elseif (SteamedRams == QUEST_AVAILABLE and player:getVar("Used_RED_RECOMMENDATION_LETTER") == 1) then
        player:startEvent(0x008);
    elseif (SteamedRams == QUEST_ACCEPTED and CharredPropeller == true and OxidizedPlate == true and ShatteredLumber == true) then
        player:startEvent(0x00C);
    elseif (SteamedRams == QUEST_ACCEPTED) then
        player:startEvent(0x00D);
    elseif (SteamedRams == QUEST_COMPLETED and player:getVar("Iron_Ram_Member") == 1) then
        player:startEvent(0x005);
    else
        player:startEvent(0x00F);
    end

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("Option: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("Option: %u",option);

    if (csid == 0x007 and option == 0) then
        player:addQuest(CRYSTAL_WAR,STEAMED_RAMS);
        player:setVar("Used_RED_RECOMMENDATION_LETTER",1);
        player:delKeyItem(RED_RECOMMENDATION_LETTER);
    elseif (csid == 0x007 and option == 1) then
        player:setVar("Used_RED_RECOMMENDATION_LETTER",1);
        player:delKeyItem(RED_RECOMMENDATION_LETTER);
    elseif (csid == 0x008 and option == 0) then
        player:addQuest(CRYSTAL_WAR,STEAMED_RAMS);
    elseif (csid == 0x00A and option == 0) then
        player:addQuest(CRYSTAL_WAR,STEAMED_RAMS);
    elseif (csid == 0x00B and option == 0) then
        player:addQuest(CRYSTAL_WAR,STEAMED_RAMS);
    elseif (csid == 0x00C and option == 0) then
    -- Todo: change this player var into a new db field for Campaign nation allegiance?
        player:setVar("Iron_Ram_Member",1);
		player:addTitle(KNIGHT_OF_THE_IRON_RAM);
        player:addKeyItem(BRONZE_RIBBON_OF_SERVICE);
        player:completeQuest(CRYSTAL_WAR,STEAMED_RAMS);
        player:delKeyItem(CHARRED_PROPELLER);
        player:delKeyItem(OXIDIZED_PLATE);
        player:delKeyItem(PIECE_OF_SHATTERED_LUMBER);
        player:messageSpecial(KEYITEM_OBTAINED,BRONZE_RIBBON_OF_SERVICE);
    elseif (csid == 0x00D and option == 1) then
        player:delQuest(CRYSTAL_WAR,STEAMED_RAMS);
    end

end;
Haven't done the other 2 nations NPC's yet.
Last edited by TeoTwawki on Thu Jun 05, 2014 8:16 am, edited 3 times in total.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Thu Jun 05, 2014 8:09 am

OMG, your scripts are so different from mine, thats crazy. I have no skills so i cannot write something like you've done... i am jealous lol.

I dont really get how you've managed to write all of this but i can definetly use it as example to learn so thats freaking awesome, thanks for sharing it, really !

Learning is frustrating and interesting at the same time, never coded or used scripts before...

May i ask how you've learned ? You've started from scratch or you somehow had another script to use as example and went from there ?

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Questions regarding my server

Post by TeoTwawki » Thu Jun 05, 2014 8:11 am

Just realized checking the mission there was a mistake and edited.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Questions regarding my server

Post by cubia » Thu Jun 05, 2014 8:12 am

Checked the mission and edited ? How come you've checked it ? My folder was empty, no npc folder, i had to start from 0 haha ^^;

Post Reply