Page 1 of 1

Pirates & Fishing

Posted: Thu Jul 05, 2018 8:32 am
by jono659
Here are a few current
Enko_2018.06.02_191221.png
Enko_2018.05.28_210955.png
DumbAss_2018.05.27_141518.png[/attachment ][attachment=3]DumbAss_2018.05.27_130821.png[/attachment ][attachment=4]DumbAss_2018.05.16_183134.png

Re: Pirates & Fishing

Posted: Sun Sep 16, 2018 11:24 am
by tagban
At one point I had a randomizer that would randomly pop you into the zone with pirates, and then would time out when they spawned. I lost that in the server moves.

Re: Pirates & Fishing

Posted: Mon Sep 17, 2018 2:09 am
by jono659
I use a rnd generator in transport.cpp that triggers 4 x rnd on the Selbina docking. Then if the random is at a certain level it selects the pirate in Selbina and/or Mhaura. The other 2 are for Sea Horror / Sea Monk.

Mhaura Zone

function onEventFinish(player,csid,option)
if (csid == 200) then
local DepartureTime = VanadielHour();
if (DepartureTime % 8 == 0) then
pirate1 = GetServerVariable("boat1");
printf("Pirate \n",boat1);
if (pirate1 >= 820) then
pzone = 227; -- Pirates
else
pzone=220; -- Selbina
end
player:setPos(0,0,0,0,pzone); -- Boat to Selbina or Pirates
elseif (DepartureTime % 8 == 4) then
player:setPos(0,0,0,0,46); -- Boat to Aht Urhgan
else
player:setPos(8,-1,5,62,249); -- Something went wrong, dump them on the dock for safety.
end
elseif (csid == 322) then
player:setVar("COP_shikarees_story",1);
end
end;

In transport

// set pirate spawn for selb and Mhaur Boats and Monk/Horror
uint32 setp = PTransport->PTransportNPC->animation = PTransport->AnimationDepart;
int ptd= PTransport->Dock.prevzone; // Looking for boat to Selbina
if (ptd == 220)
{
int n = 1;
while (n < 5)
{
long boat = dsprand::GetRandomNumber(1000);
auto boatname = "boat" + std::to_string(n);
const char* fmtQuery = "UPDATE server_variables SET value = %u WHERE name = '%s';"; //update the 4 vars for pirates and boat Mobs
int32 ret = Sql_Query(SqlHandle, fmtQuery, boat, boatname);
++n;
}
}

Re: Pirates & Fishing

Posted: Tue May 14, 2019 9:38 am
by DanteMccloud
Hey Jono does this still work? I was thinking of playing with this as I heard Master branch doesn't have it implemented. Did you add the Mhaura Zone script to just Mhaura or is it in Selbina Zone as well? Did you have to do anything other than add those scripts lines to transport and Mhaura in order to get pirates working?