Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- #
- # vim: fdm=indent fdn=1
- ###############################################################################
- # This is a bMotion plugin
- # Copyright (C) James Michael Seward 2000-2008
- # This Plugin By: Aztec03 (10/10/2018)
- #
- # This program is covered by the GPL, please refer the to LICENCE file in the
- # distribution; further information can be found in the headers of the scripts
- # in the modules directory.
- ###############################################################################
- bMotion_plugin_add_complex "story" "^%botnicks,?:?!? tell (me|us|everyone|.+) a (story|tale|legend)" 100 bMotion_plugin_complex_story "en"
- proc bMotion_plugin_complex_story { nick host handle channel text } {
- global botnicks bMotionInfo
- if {![bMotion_interbot_me_next $channel]} {
- return 0
- }
- if [regexp -nocase "^${botnicks},?:?!? tell (me|us|everyone|.+) a (story|tale|legend)" $text matches botnick who what] {
- # Following is debugging only
- #putlog "text = $text"
- #putlog "matches = $matches"
- #putlog "botnick = $botnick"
- #putlog "who = $who"
- #putlog "what = $what"
- bMotionTellStory $channel $who $nick
- return 1
- }
- }
- proc bMotionTellStory {channel targetNick forNick} {
- global botnick
- set target ''
- # Check if 'me' was the targetNick to tell a story to
- if [string match -nocase "me" $targetNick] {
- set targetNick $forNick
- set target "self"
- }
- # Check if 'us' or 'everyone' was the targetNick to tell a story to
- if [regexp -nocase "(us|everyone)" $targetNick] {
- set targetNick $channel
- set intro "%VAR{story_intros_toChannel}"
- set target "channel"
- } else {
- # Check if user is in channel
- set host [getchanhost $targetNick]
- if {$host == ""} {
- bMotionDoAction $channel $forNick "Sorry %%, but $targetNick isn't here"
- return 0
- }
- # Not telling to channel, so tell to nick
- set intro "%VAR{story_intros_toNick}"
- if {$target!="self"} { set target "nick" }
- }
- putlog "Was asked to tell a story to '$targetNick' in $channel by $forNick"
- set exposition "%VAR{story_exposition}"
- set risingAction "%VAR{story_risingAction}"
- set climax "%VAR{story_climax}"
- set fallingAction "%VAR{story_fallingAction}"
- set resolution "%VAR{story_resolution}"
- # Tell the story, using the intro
- bMotionDoAction $channel $targetNick "$intro" $forNick
- if {$target=="self"} {
- putlog "story target is $target"
- # Telling a story to self, so make them the star!
- set subject $forNick
- bMotionDoAction $channel $subject "$exposition" $forNick
- }
- if {$target=="channel" || $target=="nick"} {
- putlog "story target is $target"
- # Telling a story to channel, so make random user the subject
- set subject "%ruser"
- set prevUser "%ruser{prev}"
- bMotionDoAction $channel $subject "$exposition" $prevUser
- }
- return 0
- }
- # %% = targetNick or targetChannel
- # %2 = askingNick
- bMotion_abstract_register "story_intros_toNick" {
- "Alright %%, the story goes like this..."
- "okay %%, you're in for a treat..."
- "Gather 'round, %%, it goes like this..."
- "If you're sure, %%, then gather around..."
- "Listen carefully, %%..."
- }
- bMotion_abstract_register "story_intros_toChannel" {
- "well %%, %2 would like me to tell you a story, so it goes like this..."
- "if everyone in %% would please listen up..."
- "Okay, this one goes out to everyone in %%, gather 'round..."
- "All those in %% interested in my tale, please gather around..."
- }
- # %| = newline
- # %VAR{ABSTRACT_NAME} = pulls in another abstract
- # %% = subject or targetNick
- # %2 = askingNick
- # %ruser = random user in channel
- bMotion_abstract_register "story_exposition_intro" {
- "Once upon a time"
- "Long, long ago"
- "Eons ago"
- "Many years past"
- "In an ancient age"
- "Some time ago"
- }
- bMotion_abstract_register "story_exposition_subject_bad" {
- "was a terrible curse set upon the land by"
- "was an awful blight thrust across the farmlands by"
- "was a nasty disease spread through the towns by"
- "was disorder and chaos spread about by"
- }
- bMotion_abstract_register "story_exposition_subject_good" {
- "was peace and prosperity given to the land by"
- "were great crops to harvest all across the farmlands due to"
- "was immense prosperity and luck to all in the land, thanks to"
- "was unmatched happiness for everyone in the kingdom, because of"
- }
- bMotion_abstract_register "story_exposition_protagonist" {
- "great wizard"
- "famous paladin"
- "ancient master"
- "good king"
- }
- bMotion_abstract_register "story_exposition_antagonist" {
- "awful wizard"
- "terrible sorcerer"
- "ugly witch"
- "sneaky guy"
- "undead wight"
- }
- bMotion_abstract_register "story_exposition" {
- "%VAR{story_exposition_intro}, there %VAR{story_exposition_subject_bad} the %VAR{story_exposition_antagonist} '%%'.%|%VAR{story_risingaction_bad}%|%VAR{story_climax_bad}"
- "%VAR{story_exposition_intro}, there %VAR{story_exposition_subject_good} the %VAR{story_exposition_protagonist} '%%'.%|%VAR{story_risingaction_good}%|%VAR{story_climax_good}"
- }
- bMotion_abstract_register "story_risingaction_bad" {
- "%2 craved absolute power, and was determined to do anything to get it. They put a price out on the heads of any heroes who might stand in their way."
- "%2 was madly corrupted by his desires of the flesh, and made slaves of every virgin in the land - ordered to be part of his personal harem."
- "None would stand in %2's way, for many had tried - but all were dead."
- "It seemed for a time that %2 would have absolute, terrible power over the land, for none dared to challenge %2's authority."
- }
- bMotion_abstract_register "story_risingaction_good" {
- "%2 was then beset by a sudden illness! Woe unto the land! %2's greatest heroes were called to action to find a cure!"
- "%2 had a terrible accident at the yearly festival honoring their greatness! A sorcerer's trick went terribly awry and paralyzed poor %2..."
- "The faithful partner to %2 was afflicted by a terrible curse! They could no longer make love - a terrible thing, indeed..."
- }
- bMotion_abstract_register "story_climax_bad" {
- "There was one, though, who could take no more of %2's atrocious ways. %ruser prepared their gear, and went out on horseback, intent on ending %2's reign of terror."
- }
- bMotion_abstract_register "story_climax_good" {
- "Many good denizens of %2's land were sought out, and equally many attempts were made to solve The Great %2's problem. Just as all hope seemed lost, a new hero appeared! It was %ruser!!!"
- }
- bMotion_abstract_register "story_fallingAction_bad" {
- }
- bMotion_abstract_register "story_fallingAction_good" {
- }
- bMotion_abstract_register "story_resolution_bad" {
- }
- bMotion_abstract_register "story_resolution_good" {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement