Own private server question

Any discussion not related to the other forum topics
cubia
Posts: 44
Joined: Wed May 21, 2014 5:44 am

Re: Own private server question

Post by cubia » Sat May 31, 2014 12:01 am

So i have to rely on AH website all the time or its already somewhere in SQL ?

For example : Koga Chainmail +2

INSERT INTO `item_armor` VALUES ('10682', 'koga_chainmail_+2', '90', '4096', '89', '0', '0', '32', '0');

Edit : nvm, if i put 10682 instead of 21017 in your link, it works, so everything seems to be there.

But for the kogarasumaru 0x5219, how did you find that ? Its in hex right ? I dont know much about it, but i guess there's something to do to add it as hex. I will try with 10682 for the koga+2 and will post my result.

Thanks for helping me. I'd rather use a wiki that explains it all instead of asking questions to avoid bothering you tho ^^

Edit 2 :

will try like this :
stock = {0x3208,11340,1, --Chain Hose
0x3288,6966,1, --Greaves
0x3012,10281,1, --Kite Shield

0x3004,4482,2, --Mahogany Shield
0x321a,16552,2, --Studded Trousers
0x329a,10054,2, --Studded Boots

0x3002,544,3, --Maple Shield
0x3220,187,3, --Bronze Subligar
0x3221,1800,3, --Brass Subligar
0x3218,482,3, --Leather Trousers
0x32a0,115,3, --Bronze Leggings
0x32a1,1116,3, --Brass Leggings
0x3298,302,3} --Leather Highboots
10682} --Koga Chainmail +2
Not sure if that is going to work tho, haha !

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

Re: Own private server question

Post by kjLotus » Sat May 31, 2014 12:11 am

you'll probably need all 3 numbers per line (if you want it to cost 0, put 0)

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

Re: Own private server question

Post by cubia » Sat May 31, 2014 12:14 am

Yeah i forgot to put up the price and when i restarted the server, the npc was broken, not selling anything, i couldnt even interact with it.

Gonna retry.

Just noticed tho. I've used @spawnmob (popped Absolute Virtue) but when i logged back in, it was not up anymore. Is there any way to make sure that when you're using commands, they will still be effective the next time you're logging ?

Like if i spawn fafnir, absolute virtue, khimaira and come back later i just don't have to do it again ?

Of course it takes like 20 secondes, but curious since the mob disappear on its own.

Edit : weird....

0x3004,4482,2, --Mahogany Shield

But she's not even selling that item and price with other items do not match at all.

0x32a1,1116,3, --Brass Leggings

Brass leggings cost 1339 gils.

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Own private server question

Post by masterurat » Sat May 31, 2014 7:25 pm

The first number is the item ID, the second is it's BASe gil value (which then gets modded up/down based on your fame) and the third value is the nation rank the item is sold at.

So the shield won't be sold unless sandy is rank 2+, and brass legging's price is going up due to you probably being rank 1 fame :p

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

Re: Own private server question

Post by cubia » Sat May 31, 2014 8:01 pm

I was not thinking about nation rank, thanks for pointing it out !

I've got the kogachain mail +2 to work and its finally on sell in the npc list. Now i will work on making an npc that is going to give out gil, stuff and eventually all rank 10 for all nations, all maps and so on just to see how a script works, as i am really not sure to this kind of stuff.

Once i get it (if i ever do haha), i'll try to script the 2nd mission of WOTG just to give it a go. I might not be able to make it work tho but if i can learn something it's always cool.

Never thought codings/scripting would be that difficult. Or i am prolly just lacking brain :mrgreen:

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

Re: Own private server question

Post by Signature » Sat May 31, 2014 8:29 pm

You can edit scripts/globals/player.lua to give items to players on their First log in, making it automated and not having to make them go to an npc... Granted you can do both if you like...


scripts/globals/player.lua

Code: Select all

...  
 end
   ----- End settings.lua Perks -----

	-- SET START GIL
   --[[For some intermittent reason m_ZoneList ends up empty on characters, which is
   possibly also why they lose key items.  When that happens, CharCreate will be run and
   they end up losing their gil to the code below.  Added a conditional to hopefully
   prevent that until the bug is fixed.  Used the if instead of addGil to prevent abuse
   on servers with very high values of START_GIL, I guess.]]
   if (player:getGil() < START_GIL) then
      player:setGil(START_GIL);
   end

	-- ADD ADVENTURER COUPON
	player:addItem(0x218);

	--SET TITLE
	player:addTitle(NEW_ADVENTURER);

	-- Needs Moghouse Intro
	player:setVar("MoghouseExplication",1);

end;
Under Adventurer coupon you can add a ton of items, including player:addKeyItem();


You can also edit the Adventurer's Helper NPC which you trade the Adventurer's coupon to, Downside to this method is that you have to edit the scripts for all adventurer's helpers to do the same thing.

sripts\zones\Southern_San_dOria\npcs\Ailevia.lua

Code: Select all

-----------------------------------
--	Area: Southern San d'Oria
--	NPC: Ailevia
--	Adventurer's Assistant
--	Only recieving Adv.Coupon and simple talk event are scripted
--	This NPC participates in Quests and Missions
-- @zone 230
-- @pos -8 1 1
-------------------------------------
package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Southern_San_dOria/TextIDs");

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

function onTrade(player,npc,trade)
--Adventurer coupon
	if (trade:getItemCount() == 1 and trade:hasItemQty(0x218,1) == true) then
		player:startEvent(0x028f);
	end
-- "Flyers for Regine" conditional script
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);

	if (MagicFlyer == true and count == 1) then
		FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
		if (FlyerForRegine == 1) then
			player:messageSpecial(FLYER_REFUSED);
		end
	end
end;

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

function onTrigger(player,npc)
	player:startEvent(0x0267); -- i know a thing or 2 about these streets
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 == 0x028f) then
		player:addGil(GIL_RATE*5000);
		player:addKeyItem(CHOCOBO_LICENSE);
      player:addItem(15533);
		player:tradeComplete();
		player:messageSpecial(GIL_OBTAINED,GIL_RATE*5000);
		player:messageSpecial(KEYITEM_OBTAINED,CHOCOBO_LICENSE);
	end
end;

here the adventurers coupon trade is worth 5milion gil, they recieve a chocobo license and get a chocobo whistle.



Here is another idea, I have an Npc that teaches All BLU spells as well as all Summons for summoner. They need to trade either a blu testimoony or a smn testimony to thte npc and they learn all spells, this is what it looks like.

Code: Select all

--------------------------------------------------------------
--Rakuru-Rakoru
--Lower Jeuno
-- Adds all BLU spells or SMN savatars
--------------------------------------------------------------




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

function onTrade(player,npc,trade)
	if (trade:getItemCount() == 1 and trade:hasItemQty(2331,1) == true) then
		player:tradeComplete();
	-- Adds all BLU spells
		player:addSpell(513);
		player:addSpell(515);
		player:addSpell(517);
		player:addSpell(518);
		-- Spells 519 to 743
		z = 519;
		while z <= 743 do
			player:addSpell(z);
			z = z + 1;
		end
	end

	if (trade:getItemCount() == 1 and trade:hasItemQty(1440,1) == true) then
		player:tradeComplete();
	-- Adds all Avatars
		player:addSpell(289);
		player:addSpell(288);
		player:addSpell(290);
		player:addSpell(291);
		-- Spells 292 to 306
		z = 291;
		while z <= 306 do
			player:addSpell(z);
			z = z + 1;
		end
	end
end;

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

function onTrigger(player,npc)
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);
end;

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

Re: Own private server question

Post by cubia » Sat May 31, 2014 8:40 pm

Thanks for providing examples. I am not used to starting scripts from scratch as i have no skills, but if i keep looking at your script, try to figure out what's going on and eventually understand it, i might be able to move on something else like scripting a simple quest (before attempting WOTG Mission 2).

I know the script is going to be much more difficult for a WOTG mission since i have to write the script myself (there's no data). All i know is that we are getting an item from the npc just by talking to it, there is no trade involved. Once i'm getting the keyitem, i have to talk to another south san d'oria (S) NPC which wants to see the keyitem in order to join their group.

Just gotta find what eventID trigger everything, how to make it work etc. Long way to go but i will start with simple things before climbing mountains too high for me :D

starlightknight
Posts: 25
Joined: Sun Apr 06, 2014 11:43 am

Re: Own private server question

Post by starlightknight » Sat May 31, 2014 9:50 pm

The event ids are actually the main hard thing with scripting that stuff. If you're not able to capture them from retail, then they are a pain to find manually. Once you have them, coding the script is not very hard.

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

Re: Own private server question

Post by cubia » Sat May 31, 2014 9:51 pm

For someone who did not packet those eventID from retail, how do you actually search manually ? Mind giving me advices ? Might not be useful now be could be handy later on.

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

Re: Own private server question

Post by Signature » Sat May 31, 2014 10:28 pm

get on your gm toon. Go to the zone that you are working on (where the cut scene would take place).

use the command @cs 1 that will trigger the first cut scene that takes place in the zone, If you are savvy enough you can figure out where to start and end, if you are working on a brand new zone where no missions or cut scenes have been scripted chances are you will be starting with @cs 1 or @sc 2

Now if you're working on a zone that already has missions and cut scenes scripted you would turn the hex values in the scripts into decimal value to make it easier on yourself, then you would start with either the missing ones or the cs's that happen after, You can search google for a hex calculator the first one that comes up is perfect. http://www.mathsisfun.com/binary-decima ... erter.html

You can also use the hex values when you use the command ie: @cs 0x1ab

But i find it easier to use decimal and work my way up.

Post Reply