Quests and more Quests
Quests and more Quests
I did some more quests tonight, here is a synopsis of all the quests i've done so far. (Not sure if it included them in this patch or not so im going to include them anyways)
The Setting Sun (Done and Complete)
Breaking Stones (Done and Complete)
Her Majesty's Garden (Done and Complete)
Stardust (Done and Complete)
The Setting Sun (Done and Complete)
Breaking Stones (Done and Complete)
Her Majesty's Garden (Done and Complete)
Stardust (Done and Complete)
- Attachments
-
- ex0r.patch
- (15.15 KiB) Downloaded 328 times
-
- Posts: 238
- Joined: Wed Sep 05, 2012 10:48 am
Re: Quests and more Quests
Awesome work man, quests were one of my favorite parts of FFXI
keep them coming
keep them coming
Re: Quests and more Quests
Over the next week or so I plan on getting quite a bit of them done, been going through the list seeing which ones are done and which ones aren't. I'm still new to scripting so some of the advanced quests I won't be attempting yet, but alot of the other ones I will do for sure.
Re: Quests and more Quests
Code: Select all
function alreadyCheckedNPC(player,number)
local wildcatSandy = player:getVar("wildcatSandy_var");
local bit = {};
for i = 19,0,-1 do
twop = 2^i;
if(wildcatSandy >= twop) then
bit[i+1] = 1;
wildcatSandy = wildcatSandy - twop;
else
bit[i+1] = 0;
end;
end;
if(bit[number] == 0) then
return false;
else
return true;
end
end;
Code: Select all
if (player:getVar("wildcatSandy_var") % 2 * 0x80000 >= 0x80000) then;
-- TODO
end
(value % 2 * bit) < bit -- there isn't a bit
how it work:
1100101001010111b = 51799
1000000b = 64
let's find this bit
1100101001010111b % 2 * 1000000b >= 1000000b (51799 % 2 * 64 >= 64)
2 * 1000000b == 10000000b
% will remove all bits at the beginning (we have 7 bit in 10000000b then will remove 8,9,10,11,12,13,14,15 and 16 bit)
1100101001010111b % 10000000b = 1010111b (01010111b)
now
1010111b >= 1000000b = true
but it work for one bit only
P.S. I hope that I could explain this principle ^^
Re: Quests and more Quests
you can delete this part, this quest is not implemented because it's aht urhgan, and now we have new lua function for that
int32 setMaskBit(lua_State*); // Sets a single bit in a character variable
int32 getMaskBit(lua_State*); // Retrieves a single bit in a character variable
int32 isMaskFull(lua_State*); // Checks if a bitmask stored in a character varable of a specified size contains all set bits
int32 setMaskBit(lua_State*); // Sets a single bit in a character variable
int32 getMaskBit(lua_State*); // Retrieves a single bit in a character variable
int32 isMaskFull(lua_State*); // Checks if a bitmask stored in a character varable of a specified size contains all set bits
New Gilgamesh Server --> http://gilgamesh.servegame.com
Re: Quests and more Quests
I'm sorry, what is this in reference to? I don't remember using any of that stuff in my quest scripts. There was some stuff already in the NPC files, so it's possible somebody else worked on some incomplete stuff.
Re: Quests and more Quests
это не очень хорошее решение в большинстве случаевEzekyel wrote:you can delete this part, this quest is not implemented because it's aht urhgan, and now we have new lua function for that
int32 setMaskBit(lua_State*); // Sets a single bit in a character variable
int32 getMaskBit(lua_State*); // Retrieves a single bit in a character variable
int32 isMaskFull(lua_State*); // Checks if a bitmask stored in a character varable of a specified size contains all set bits
check Norg/npcs/Mamaulabion.lua
Code: Select all
if(player:getQuestStatus(OUTLANDS,MAMA_MIA) == QUEST_ACCEPTED) then
if(trade:hasItemQty(1202,1) and trade:getItemCount() == 1) then -- Trade Bubbly water
wasSet = player:getMaskBit("tradesMamaMia",0)
player:setMaskBit("tradesMamaMia",0,true)
if(player:isMaskFull("tradesMamaMia",7) == true) then
player:startEvent(0x00C3); -- Traded all seven items
elseif(wasSet) then
player:startEvent(0x00C2); -- Traded an item you already gave
else
player:startEvent(0x00C1); -- Traded an item
end
player:setMaskBit("tradesMamaMia",0,true) - 2 queries to db
player:isMaskFull("tradesMamaMia",7) == true - 1 query to db
итог: 5 queries
если заменить все это на формулу
(value % 2 * bit) >= bit
то к базе в итоге уйдет лишь 2 queries
2 queries VS 5 queries
-
- Developer
- Posts: 707
- Joined: Sun Jul 22, 2012 12:11 am
Re: Quests and more Quests
The number of queries can be cut down by caching the variable first (it would add an extra step to the scripting and an extra argument to the functions, but it would bring it down to 2 queries). Those functions do provide a way of using the efficient storage of bitmasks without having to actually understand them, which is a great benefit to the scripters.
Re: Quests and more Quests
идея хорошая, но реализация плохаяbluekirby0 wrote:Those functions do provide a way of using the efficient storage of bitmasks without having to actually understand them, which is a great benefit to the scripters.