View Full Version : [SHARE] Interlude Prime Hours AI
Probably some of you know that one of the changes in Interlude was that Prime Hours thing, whats that ? During some hours of the day (the hours when servers has more players connected) the price of GKs are reduced, so, if we want to implement this first we need to modify teleport AI TELEPORT_REQUESTED handler and here is the needed code and compiled ofc.
You will need to add to each single teleporter a new telposlist called PositionPH, that telposlist will have the reduced prices. Be carefull addin this because if you forgot to add that new telposlist to all GKs when Prime Hours come that GK isnt going to work, is going to show only the default parameters, in this case, Talking Island only Roll Eyes (Sarcastic)
Thanks to Sauron because he give me a hint when i was trying to code this and inspire this job.
Compiled by hand and brain, as always, there is no better compiler than your own mind Cool
This is the NASC code of the addon (not the entire AI), requested by smeli... this is free, not DCs Smile
Code:
if( PrimeHours )
{
i0 = gg->GetDateTime(0,3);
i1 = gg->GetDateTime(0,6);
if ( (i0 >= PHfromHour) && (i0 <= PHtoHour) && (i1 >= PHfromDay) && (i1 <= PHtoDay) )
{
myself->Teleport(talker,PositionPH,ShopName,"","","",57,myself->MakeFString(1000308,"","","","",""));
return;
}
}
Do you like this share ? Click the button please Razz
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
thanks, here 5 dc
can you send me uncompiled one?
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
bfgsnake
12.10.2007, 22:00
Use HF script maker or Sauron decompiler to get uncompiled code Smile
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
Quote:
Originally Posted by smeli
View Post (https://postpacific.mmorpg-game.online/showpost.php?p=1003624)
thanks, here 5 dc
can you send me uncompiled one?
Added to the first post.
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
LoVeRSaMa
12.10.2007, 22:00
Quote:
Originally Posted by FidoW
View Post (https://postpacific.mmorpg-game.online/showpost.php?p=1003623)
there is no better compiler than your own mind Cool
Lies.
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
1/99 post in 1 week who its really useful, thanks fidow DC for you.
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
Osito2Dancer
12.10.2007, 22:00
Nice share, 5DC for you!
A question: which are the "prime hours"? 8-12? 6-12?
Oso
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (2 Days Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
mcrabben7
14.10.2007, 02:00
The days don't make any sense. I was testing it and 0 = Saturday, but later it didn't. I'm confused.
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (20 Hours Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
Quote:
Originally Posted by mcrabben7
View Post (https://postpacific.mmorpg-game.online/showpost.php?p=1003630)
The days don't make any sense. I was testing it and 0 = Saturday, but later it didn't. I'm confused.
Well.. the days stuff you can delete it.. isnt really necessary.
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (20 Hours Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).
sikorskys
14.10.2007, 08:00
Quote:
Originally Posted by mcrabben7
View Post (https://postpacific.mmorpg-game.online/showpost.php?p=1003630)
The days don't make any sense. I was testing it and 0 = Saturday, but later it didn't. I'm confused.
It's working:
Code:
// i_ai4 = gg->GetDateTime(0,6);
push_event // myself
push_const 704
add
fetch_i // i_ai4
push_const 324
add
push_reg_sp
fetch_i
push_event // gg
push_const 632
add
fetch_i
push_const 0
push_const 6
func_call 218234890 // func[GetDateTime]
shift_sp -2
assign4
shift_sp -1
// Monday - Friday
push_event // myself
push_const 704
add
fetch_i // i_ai4
push_const 324
add
fetch_i4
push_const 1
greater_equal
branch_false L200
push_event // myself
push_const 704
add
fetch_i // i_ai4
push_const 324
add
fetch_i4
push_const 5
less_equal
branch_false L200
... do something
Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Дата оценена по относительному времени в снимке (14 Hours Ago); точное время не сохранилось. Открыть источник (https://web.archive.org/web/20071014230016id_/http://postpacific.com:80/forums/showthread.php?s=&p=101806).