new events (pda spam, trivial and mundane news items, lotto, hacker)

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-02-26 02:59:35 +10:00
parent 02ace92b04
commit cfa3916b95
10 changed files with 582 additions and 39 deletions

View File

@@ -36,10 +36,21 @@
// Maps event names to event chances
// For each chance, 100 represents "normal likelihood", anything below 100 is "reduced likelihood", anything above 100 is "increased likelihood"
// Events have to be manually added to this proc to happen
var/list/possibleEvents = list()
// Check for additional possible events
possibleEvents[/datum/event/economic_event] = 100 //see Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
//see:
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm
possibleEvents[/datum/event/economic_event] = 200
possibleEvents[/datum/event/trivial_news] = 300
possibleEvents[/datum/event/mundane_news] = 200
possibleEvents[/datum/event/pda_spam] = max(min(25, player_list.len) * 4, 200)
possibleEvents[/datum/event/money_lotto] = max(min(5, player_list.len), 50)
if(account_hack_attempted)
possibleEvents[/datum/event/money_hacker] = max(min(25, player_list.len) * 4, 200)
possibleEvents[/datum/event/carp_migration] = 50 + 50 * active_with_role["Engineer"]
possibleEvents[/datum/event/brand_intelligence] = 50 + 25 * active_with_role["Janitor"]

View File

@@ -2,8 +2,8 @@ var/list/allEvents = typesof(/datum/event) - /datum/event
var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
//var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event - /datum/event/spider_infestation - /datum/event/alien_infestation
var/eventTimeLower = 15000 //15 minutes
var/eventTimeUpper = 30000 //30 minutes
var/eventTimeLower = 10000 //15 minutes
var/eventTimeUpper = 25000 //30 minutes
var/scheduledEvent = null

View File

@@ -0,0 +1,120 @@
/var/global/account_hack_attempted = 0
/datum/event/money_hacker
endWhen = 10000
var/time_duration = 0
var/time_start = 0
var/datum/money_account/affected_account
var/obj/machinery/account_database/affected_db
/datum/event/money_hacker/setup()
for(var/obj/machinery/account_database/DB in world)
if( DB.z == 1 && !(DB.stat&NOPOWER) && DB.activated && DB.accounts.len)
affected_db = DB
break
if(affected_db)
affected_account = pick(affected_db.accounts)
else
kill()
return
time_start = world.time
time_duration = rand(3000, 18000)
endWhen = time_duration * 10 //a big enough buffer so that we should timeout before we run out of ticks
account_hack_attempted = 1
/datum/event/money_hacker/start()
return
/datum/event/money_hacker/announce()
var/message = "A brute force hack has been detected (in progress since [worldtime2text()]). The target of the attack is: Financial account #[affected_account.account_number], \
without intervention this attack will succeed in [time_duration / 600] minutes. Required intervention: complete shutdown of affected accounts databases until the attack has ceased. \
Notifications will be sent as updates occur.<br>"
var/my_department = "[station_name()] firewall subroutines"
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
var/pass = 0
for(var/obj/machinery/message_server/MS in world)
if(!MS.active) continue
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
pass = 1
if(pass)
var/keyed_dpt1 = ckey("Engineering")
var/keyed_dpt2 = ckey("Security")
var/keyed_dpt3 = ckey("Bridge")
for (var/obj/machinery/requests_console/Console in allConsoles)
var/keyed_department = ckey(Console.department)
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
if(Console.newmessagepriority < 2)
Console.newmessagepriority = 2
Console.icon_state = "req_comp2"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(5, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
/datum/event/money_hacker/tick()
if(world.time > time_start + time_duration)
var/message
if(affected_account && affected_db && affected_db.activated && !(affected_db.stat & (NOPOWER|BROKEN)) )
//hacker wins
message = "The hack attempt has succeeded."
//subtract the money
var/lost = affected_account.money * 0.8 + (rand(2,4) - 2) / 10
affected_account.money -= lost
//create a taunting log entry
var/datum/transaction/T = new()
T.target_name = pick("","yo brotha from anotha motha","el Presidente","chieF smackDowN")
T.purpose = pick("Ne$ ---ount fu%ds init*&lisat@*n","PAY BACK YOUR MUM","Funds withdrawal","pWnAgE","l33t hax","liberationez")
T.amount = pick("","([rand(0,99999)])","alla money","9001$","HOLLA HOLLA GET DOLLA","([lost])")
var/date1 = "31 December, 1999"
var/date2 = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [rand(1000,3000)]"
T.date = pick("", current_date_string, date1, date2)
var/time1 = rand(0, 99999999)
var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]"
T.time = pick("", worldtime2text(), time2)
T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD")
affected_account.transaction_log.Add(T)
else
//crew wins
message = "The attack has ceased, the affected databases can now be brought online."
var/my_department = "[station_name()] firewall subroutines"
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
var/pass = 0
for(var/obj/machinery/message_server/MS in world)
if(!MS.active) continue
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
pass = 1
if(pass)
var/keyed_dpt1 = ckey("Engineering")
var/keyed_dpt2 = ckey("Security")
var/keyed_dpt3 = ckey("Bridge")
for (var/obj/machinery/requests_console/Console in allConsoles)
var/keyed_department = ckey(Console.department)
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
if(Console.newmessagepriority < 2)
Console.newmessagepriority = 2
Console.icon_state = "req_comp2"
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(5, Console.loc))
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
kill()
//shouldn't ever hit this, but this is here just in case
/datum/event/money_hacker/end()
if(affected_account && affected_db)
endWhen += time_duration

View File

@@ -0,0 +1,40 @@
/datum/event/money_lotto
endWhen = 301
announceWhen = 300
var/winner_name = "John Smith"
var/winner_sum = 0
var/deposit_success = 0
/datum/event/money_lotto/start()
winner_sum = pick(5000, 10000, 50000, 100000, 500000, 1000000, 1500000)
if(centcomm_account_db.accounts.len)
var/datum/money_account/D = pick(centcomm_account_db.accounts)
D.money += winner_sum
var/datum/transaction/T = new()
T.target_name = "Tau Ceti Daily Grand Slam -Stellar- Lottery"
T.purpose = "Winner!"
T.amount = winner_sum
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = "Biesel TCD Terminal #[rand(111,333)]"
D.transaction_log.Add(T)
else
kill()
/datum/event/money_lotto/announce()
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = "NanoTrasen Editor"
newMsg.is_admin_message = 1
newMsg.body = "TC Daily wishes to congratulate <b>[winner_name]</b> for recieving the Tau Ceti Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!"
if(!deposit_success)
newMsg.body += "<br>Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of $500 to TCD 'Stellar Slam' office on Biesel Prime containing updated details, and it'll be resent within the month."
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == "Tau Ceti Daily")
FC.messages += newMsg
break
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.newsAlert("Tau Ceti Daily")

View File

@@ -0,0 +1,102 @@
/datum/event/pda_spam
endWhen = 6000
var/time_failed = 0
var/obj/machinery/message_server/useMS
/datum/event/pda_spam/setup()
time_failed = world.time
for (var/obj/machinery/message_server/MS in message_servers)
if(MS.active)
useMS = MS
break
/datum/event/pda_spam/tick()
if(!useMS.active)
useMS = null
if(!useMS && message_servers)
for (var/obj/machinery/message_server/MS in message_servers)
if(MS.active)
useMS = MS
break
if(useMS)
time_failed = world.time
if(prob(2))
// /obj/machinery/message_server/proc/send_pda_message(var/recipient = "",var/sender = "",var/message = "")
var/obj/item/device/pda/P
var/list/viables = list()
for(var/obj/item/device/pda/check_pda in sortAtom(PDAs))
if (!check_pda.owner||check_pda.toff||check_pda == src||check_pda.hidden)
continue
viables.Add(check_pda)
if(!viables.len)
return
P = pick(viables)
var/sender
var/message
switch(pick(1,2,3,4,5))
if(1)
sender = pick("MaxBet","MaxBet Online Casino","There is no better time to register","I'm excited for you to join us")
message = pick("Triple deposits are waiting for you at MaxBet Online when you register to play with us.",\
"You can qualify for a 200% Welcome Bonus at MaxBet Online when you sign up today.",\
"Once you are a player with MaxBet, you will also receive lucrative weekly and monthly promotions.",\
"You will be able to enjoy over 450 top-flight casino games at MaxBet.")
if(2)
sender = pick(300;"QuickDatingSystem",200;"Find your russian bride",50;"Tajaran beauties are waiting",50;"Find your secret skrell crush",50;"Beautiful unathi brides")
message = pick("Your profile caught my attention and I wanted to write and say hello (QuickDating).",\
"If you will write to me on my email [pick(first_names_female)]@[pick(last_names)].[pick("ru","ck","tj","ur","nt")] I shall necessarily send you a photo (QuickDating).",\
"I want that we write each other and I hope, that you will like my profile and you will answer me (QuickDating).",\
"You have (1) new message!",\
"You have (2) new profile views!")
if(3)
sender = pick("Galactic Payments Association","Better Business Bureau","Tau Ceti E-Payments","NAnoTransen Finance Deparmtent","Luxury Replicas")
message = pick("Luxury watches for Blowout sale prices!",\
"Watches, Jewelry & Accessories, Bags & Wallets !",\
"Deposit 100$ and get 300$ totally free!",\
" 100K NT.|WOWGOLD <20>nly $89 <HOT>",\
"We have been filed with a complaint from one of your customers in respect of their business relations with you.",\
"We kindly ask you to open the COMPLAINT REPORT (attached) to reply on this complaint..")
if(4)
sender = pick("Buy Dr. Maxman","Having dysfuctional troubles?")
message = pick("DR MAXMAN: REAL Doctors, REAL Science, REAL Results!",\
"Dr. Maxman was created by George Acuilar, M.D, a CentComm Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\
"After seven years of research, Dr Acuilar and his team came up with this simple breakthrough male enhancement formula.",\
"Men of all species report AMAZING increases in length, width and stamina.")
if(5)
sender = pick("Dr","Crown prince","King Regent","Professor","Captain")
sender += " " + pick("Robert","Alfred","Josephat","Kingsley","Sehi","Zbahi")
sender += " " + pick("Mugawe","Nkem","Gbatokwia","Nchekwube","Ndim","Ndubisi")
message = pick("YOUR FUND HAS BEEN MOVED TO [pick("Salusa","Segunda","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus")] DEVELOPMENTARY BANK FOR ONWARD REMITTANCE.",\
"We are happy to inform you that due to the delay, we have been instructed to IMMEDIATELY deposit all funds into your account",\
"Dear fund beneficiary, We have please to inform you that overdue funds payment has finally been approved and released for payment",\
"Due to my lack of agents I require an off-world financial account to immediately deposit the sum of 1 POINT FIVE MILLION credits.",\
"Greetings sir, I regretfully to inform you that as I lay dying here due to my lack ofheirs I have chosen you to recieve the full sum of my lifetime savings of 1.5 billion credits")
useMS.send_pda_message("[P.owner]", sender, message)
if (prob(50)) //Give the AI an increased chance to intercept the message
for(var/mob/living/silicon/ai/ai in mob_list)
// Allows other AIs to intercept the message but the AI won't intercept their own message.
if(ai.aiPDA != P && ai.aiPDA != src)
ai.show_message("<i>Intercepted message from <b>[sender]</b></i> (Unknown / spam?) <i>to <b>[P:owner]</b>: [message]</i>")
P.tnote += "<i><b>&larr; From [sender] (Unknown / spam?):</b></i><br>[message]<br>"
if (!P.silent)
playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1)
for (var/mob/O in hearers(3, P.loc))
if(!P.silent) O.show_message(text("\icon[P] *[P.ttone]*"))
//Search for holder of the PDA.
var/mob/living/L = null
if(P.loc && isliving(P.loc))
L = P.loc
//Maybe they are a pAI!
else
L = get(P, /mob/living/silicon)
if(L)
L << "\icon[P] <b>Message from [sender] (Unknown / spam?), </b>\"[message]\" (Unable to Reply)"
else if(world.time > time_failed + 1200)
//if there's no server active for two minutes, give up
kill()