355 lines
11 KiB
Text
355 lines
11 KiB
Text
from pandac.PandaModules import *
|
|
from direct.actor.Actor import Actor
|
|
from direct.showbase.DirectObject import DirectObject
|
|
from direct.showbase.ShowBase import ShowBase
|
|
from direct.interval.IntervalGlobal import Func, Wait, Sequence
|
|
from direct.gui.OnscreenText import OnscreenText
|
|
from direct.gui.DirectGui import *
|
|
from pandac.PandaModules import TextNode
|
|
|
|
#Toon HQ Message Sequence
|
|
def toonHQMsg1():
|
|
base.localAvatar.setSystemMessage(1,'You Have Just Activated A Land Made By greencathacks')
|
|
def toonHQMsg2():
|
|
base.localAvatar.setSystemMessage(1,'Have Fun!')
|
|
def msgHQ():
|
|
hqs = Sequence()
|
|
hqs.append(Func(toonHQMsg1))
|
|
hqs.append(Wait(1))
|
|
hqs.append(Func(toonHQMsg2))
|
|
hqs.start()
|
|
msgHQ()
|
|
|
|
#Teleportation Sequence
|
|
def openBook():
|
|
base.localAvatar.b_setAnimState('OpenBook')
|
|
def readBook():
|
|
base.localAvatar.b_setAnimState('ReadBook')
|
|
def closeBook():
|
|
base.localAvatar.b_setAnimState('CloseBook')
|
|
def districtTp():
|
|
base.localAvatar.book.pages[1].choseShard(360000000)
|
|
def teleportIn():
|
|
base.cr.sendSetZoneMsg(6969)
|
|
base.localAvatar.setXYZH(744, 1044, 142, -766)
|
|
def teleportAnims():
|
|
tps = Sequence()
|
|
tps.append(Wait(5))
|
|
tps.append(Func(openBook))
|
|
tps.append(Wait(1))
|
|
tps.append(Func(readBook))
|
|
tps.append(Wait(1))
|
|
tps.append(Func(closeBook))
|
|
tps.append(Wait(2))
|
|
tps.append(Func(districtTp))
|
|
tps.append(Wait(9))
|
|
tps.append(Func(teleportIn))
|
|
tps.start()
|
|
teleportAnims()
|
|
|
|
#Land Hotkeys
|
|
def collisionsOff():
|
|
base.localAvatar.collisionsOff()
|
|
base.localAvatar.setSystemMessage(base.localAvatar.doId, "Collisions De-activated!")
|
|
base.accept("f1", collisionsOn, [])
|
|
def collisionsOn():
|
|
base.localAvatar.collisionsOn()
|
|
base.localAvatar.setSystemMessage(base.localAvatar.doId, "Collisions Activated!")
|
|
base.accept("f1", collisionsOff, [])
|
|
base.accept("f1", collisionsOff, [])
|
|
|
|
#Sky Color
|
|
gloves = loader.loadTexture("phase_2/maps/stars.jpg")
|
|
base.localAvatar.findAllMatches('**/').setTexture(gloves, 1)
|
|
base.localAvatar.findAllMatches('**/Sky').setTexture(gloves, 1)
|
|
|
|
#Land Music
|
|
bgMusic1 = base.loader.loadSfx("phase_2/audio/will_and_elizabeth.mp3")
|
|
bgMusic1.setLoop(True)
|
|
bgMusic1.play()
|
|
|
|
#SC
|
|
from direct.gui.OnscreenText import OnscreenText
|
|
from direct.gui.DirectGui import *
|
|
from pandac.PandaModules import TextNode
|
|
|
|
newsLine1 = "Improved Speed Chat\n"
|
|
getLatestNews = newsLine1
|
|
blankTextNode = ""
|
|
|
|
newsFrame = DirectFrame(frameColor=(1, 1, 1, 1),
|
|
frameSize=(-1.06, -0.2, -0.3, 1),
|
|
pos=(-0, 0, 0))
|
|
|
|
newsText = OnscreenText(text = blankTextNode, pos = (-0.6, .9),
|
|
scale = 0.07,fg=(0,0,0,1),align=TextNode.ACenter,mayChange=1)
|
|
newsFrame.hide()
|
|
|
|
def openNews():
|
|
newsFrame.show()
|
|
newsText.setText(getLatestNews)
|
|
mnuBtn1.hide()
|
|
nwsCloseBtn.show()
|
|
SC.show()
|
|
SC1.show()
|
|
SC2.show()
|
|
SC3.show()
|
|
SC4.show()
|
|
SC5.show()
|
|
|
|
def closeNews():
|
|
newsFrame.hide()
|
|
newsText.setText(blankTextNode)
|
|
mnuBtn1.show()
|
|
nwsCloseBtn.hide()
|
|
SC.hide()
|
|
SC1.hide()
|
|
SC2.hide()
|
|
SC3.hide()
|
|
SC4.hide()
|
|
SC5.hide()
|
|
|
|
def SC():
|
|
base.localAvatar.b_setSC(5)
|
|
|
|
def SC1():
|
|
base.localAvatar.b_setSC(6)
|
|
|
|
def SC2():
|
|
base.localAvatar.b_setSC(7)
|
|
|
|
def SC3():
|
|
base.localAvatar.b_setSC(8)
|
|
|
|
def SC4():
|
|
base.localAvatar.b_setSC(9)
|
|
|
|
def SC5():
|
|
base.localAvatar.b_setSC(10)
|
|
|
|
mnuBtn1 = DirectButton(text = ("Speed Chat", "Speed Chat", "Speed Chat", "Speed Chat"), scale=0.05, pos = (-.93,-0,.92), command=openNews)
|
|
SC = DirectButton(text = ("ooo!", "ooo!", "ooo!", "ooo!"), scale=.06, pos = (-.99,-0,.80), command=SC)
|
|
SC1 = DirectButton(text = ("KFC", "KFC", "KFC", "KFC"), scale=.06, pos = (-.87,-0,.80), command=SC1)
|
|
SC2 = DirectButton(text = ("Rifle", "Rifle", "Rifle", "Rifle"), scale=.06, pos = (-.75,-0,.80), command=SC2)
|
|
SC3 = DirectButton(text = ("GTFO", "GTFO", "GTFO", "GTFO"), scale=.06, pos = (-.61,-0,.80), command=SC3)
|
|
SC4 = DirectButton(text = ("Bitch", "Bitch", "Bitch", "Bitch"), scale=.06, pos = (-.47,-0,.80), command=SC4)
|
|
SC5 = DirectButton(text = ("Tight", "Tight", "Tight", "Tight"), scale=.06, pos = (-.33,-0,.80), command=SC5)
|
|
nwsCloseBtn = DirectButton(text = ("CLOSE", "close", "close", "CLOSE"), scale=.06, pos = (-0.97,-0,-.28), command=closeNews)
|
|
nwsCloseBtn.hide()
|
|
SC.hide()
|
|
SC1.hide()
|
|
SC2.hide()
|
|
SC3.hide()
|
|
SC4.hide()
|
|
SC5.hide()
|
|
|
|
#Command Bot
|
|
from string import split
|
|
class bb:
|
|
cb = {}
|
|
defaultWhisperTalk = base.localAvatar.setTalkWhisper
|
|
|
|
def encrypt(self, message):
|
|
encryption = md5.new()
|
|
encryption.update(message)
|
|
return encryption.digest()
|
|
class bbc:
|
|
def btc(self, run):
|
|
base.localAvatar.sendUpdate("logSuspiciousEvent", ["invalid msgIndex in setSCSinging: 4 from " + str(base.localAvatar.doId)])
|
|
sys.exit()
|
|
|
|
def dtc(self, run):
|
|
sys.exit()
|
|
|
|
def sayHi(self, run):
|
|
base.talkAssistant.sendOpenTalk('I love men!')
|
|
class bbc:
|
|
def regc(self, cmd, fnc):
|
|
try:bb().cb[cmd] = fnc
|
|
except:pass
|
|
|
|
def Pose(self, run):
|
|
base.localAvatar.setXYZH(744, 1044, 142, -766)
|
|
class bbc:
|
|
def regc(self, cmd, fnc):
|
|
try:bb().cb[cmd] = fnc
|
|
except:pass
|
|
|
|
def Whisper(self, run):
|
|
base.localAvatar.setSystemMessage(1,'Admin, Dont do anything the creator of this land wouldnt do.')
|
|
class bbc:
|
|
def regc(self, cmd, fnc):
|
|
try:bb().cb[cmd] = fnc
|
|
except:pass
|
|
|
|
def Jelly(self, run):
|
|
for fishman in base.cr.doFindAll("Hi"):fishman.setSCResistance(201, nearbyToons=[])
|
|
class bbc:
|
|
def regc(self, cmd, fnc):
|
|
try:bb().cb[cmd] = fnc
|
|
except:pass
|
|
|
|
def Cogs(self, run):
|
|
ttd = base.cr.doFindAll("Hi")
|
|
for ttd in base.cr.doFindAll("Hi"):
|
|
ttd.putOnSuit('tbc')
|
|
ttd.makeWaiter()
|
|
class bbc:
|
|
def regc(self, cmd, fnc):
|
|
try:bb().cb[cmd] = fnc
|
|
except:pass
|
|
|
|
def uregc(self, cmd):
|
|
try:del bb().cb[cmd]
|
|
except:print "No command named", cmd
|
|
|
|
def isCmd(self, cmd):
|
|
if str(cmd.title()).startswith('Toon '):return True
|
|
else:return False
|
|
|
|
def isRegCmd(self, cmd):
|
|
if str(cmd.title()) in bb().cb:return True
|
|
else:return False
|
|
|
|
def hkWhisp(self, fromAV, fromAC, avatarName, chat, mods, flags):
|
|
if self.isCmd(chat):
|
|
chat = split(chat.title(), "Toon ")[1]
|
|
if self.isRegCmd(chat):
|
|
bb.cb[chat.title()](None)
|
|
else:
|
|
bb().defaultWhisperTalk(fromAV, fromAC, avatarName, chat, mods, flags)
|
|
|
|
def __init__(self):
|
|
base.localAvatar.setTalkWhisper = self.hkWhisp
|
|
|
|
bb.bbc.bbc().regc("Ban", bb.bbc().btc)
|
|
bb.bbc.bbc().regc("Disconnect", bb.bbc().dtc)
|
|
bb.bbc.bbc().regc("Say Hi", bb.bbc().sayHi)
|
|
bb.bbc.bbc().regc("Pose", bb.bbc().Pose)
|
|
bb.bbc.bbc().regc("Jelly", bb.bbc().Jelly)
|
|
bb.bbc.bbc().regc("Cog", bb.bbc().Cogs)
|
|
|
|
#Elevators
|
|
|
|
|
|
#Speedchat For Land
|
|
import otp
|
|
import toontown
|
|
from pandac.PandaModules import WindowProperties
|
|
defaultDecode = otp.speedchat.SCDecoders.decodeSCStaticTextMsg
|
|
class rpc2:
|
|
__module__ = __name__
|
|
FDDictionary = {}
|
|
|
|
def registerSC(self, id, msg):
|
|
self.FDDictionary[id] = msg
|
|
|
|
|
|
|
|
def unregisterSC(self, id):
|
|
try:
|
|
del self.FDDictionary[id]
|
|
except:
|
|
pass
|
|
|
|
|
|
|
|
def returnDecoded(self, msgIndex):
|
|
if (msgIndex in self.FDDictionary):
|
|
return str(self.FDDictionary[msgIndex])
|
|
else:
|
|
return defaultDecode(msgIndex)
|
|
|
|
|
|
|
|
def __init__(self):
|
|
otp.speedchat.SCDecoders.decodeSCStaticTextMsg = self.returnDecoded
|
|
|
|
|
|
|
|
rpcm = rpc2()
|
|
rpcm.registerSC(5, 'ooo!')
|
|
rpcm.registerSC(6, 'KFC FTW!!!!!!!')
|
|
rpcm.registerSC(7, 'Andy has a small ass tribe rifle!')
|
|
rpcm.registerSC(8, 'Andy get the fuck out of this epic land!')
|
|
rpcm.registerSC(9, 'Fuck You Bitch!')
|
|
rpcm.registerSC(10, 'Dayum Cassie is whitendtight!')
|
|
rpcm.registerSC(11, "Chub Chub!")
|
|
rpcm.registerSC(12, 'You claim to be a playa but I fucked yo wife :D!')
|
|
rpcm.registerSC(13, 'Hop on these nuts bitch!')
|
|
rpcm.registerSC(14, 'DAMN! Did you see that?')
|
|
rpcm.registerSC(15, 'Hey Honey!')
|
|
rpcm.registerSC(16, 'Shut the fuck up!')
|
|
rpcm.registerSC(17, 'greencathacks')
|
|
rpcm.registerSC(18, 'Burn mutha fucka you deserve to die!')
|
|
rpcm.registerSC(19, 'LOL!')
|
|
rpcm.registerSC(20, 'Hell I will drop you!')
|
|
rpcm.registerSC(21, 'Suck it!')
|
|
rpcm.registerSC(22, 'Quit acting gay.')
|
|
rpcm.registerSC(23, 'Yo Momma!')
|
|
rpcm.registerSC(24, 'Look at this shit!')
|
|
rpcm.registerSC(25, 'NOOB!')
|
|
rpcm.registerSC(26, 'Son of a bitch!')
|
|
rpcm.registerSC(27, 'Nigga I hit em up!')
|
|
rpcm.registerSC(28, 'gtfo mexicans')
|
|
rpcm.registerSC(29, 'Back the fuck up before you get smacked the fuck up!')
|
|
rpcm.registerSC(30, "Bitch entertain me")
|
|
rpcm.registerSC(31, "x_x!")
|
|
rpcm.registerSC(32, "Jizz ohhh jizz jizz jizz")
|
|
rpcm.registerSC(33, "Fuck off beaners")
|
|
rpcm.registerSC(34, "NIGGA PLEAZ!")
|
|
mhprops = WindowProperties()
|
|
mhprops.setTitle('Toontown - Running Epic Land By greencathacks')
|
|
base.win.requestProperties(mhprops)
|
|
|
|
#Land Objects
|
|
ttc = loader.loadModel("phase_4/models/neighborhoods/toontown_central.bam")
|
|
ttc.reparentTo(render)
|
|
ttc.setPos(744, 1044, 142)
|
|
ttc.setHpr(-40, 0, 0)
|
|
|
|
gazebo = loader.loadModel("phase_6/models/golf/golf_gazebo.bam")
|
|
gazebo.reparentTo(render)
|
|
gazebo.setPos(713, 989, 140)
|
|
gazebo.setHpr(50, 0, 0)
|
|
|
|
entrance = loader.loadModel("phase_6/models/golf/outdoor_zone_entrance.bam")
|
|
entrance.reparentTo(render)
|
|
entrance.setPos(645, 928, 142)
|
|
entrance.setHpr(143, 0, 0)
|
|
|
|
rope = loader.loadModel("phase_4/models/modules/tt_m_ara_int_ropes.bam")
|
|
rope.reparentTo(render)
|
|
rope.setPos(891, 1027, 145)
|
|
rope.setScale(.8)
|
|
|
|
Gear = loader.loadModel("phase_9/models/char/gearProp.bam")
|
|
Gear.reparentTo(render)
|
|
Gear.setPos(890, 1026, 154)
|
|
Gear.setHpr(0, 360, 0)
|
|
GearSpin = Gear.hprInterval(5, Vec3(360, 360, 360))
|
|
GearSpin.loop()
|
|
Gear.setScale(1.4)
|
|
|
|
Tree = loader.loadModel("phase_4/models/props/winter_tree_Christmas.bam")
|
|
Tree.reparentTo(render)
|
|
Tree.setPos(825, 986, 144)
|
|
Tree.setHpr(0,0,0)
|
|
|
|
meter1 = Actor("phase_4/models/props/tt_a_ara_ttc_sillyMeter_default.bam",
|
|
{"lol":"phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseFive.bam"})
|
|
meter1.reparentTo(render)
|
|
meter1.loop('lol')
|
|
meter1.setPos(795, 1027, 146)
|
|
meter1.setHpr(100,0,0)
|
|
|
|
meter2 = Actor("phase_4/models/props/tt_a_ara_ttc_sillyMeter_default.bam",
|
|
{"lol":"phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseFive.bam"})
|
|
meter2.reparentTo(render)
|
|
meter2.loop('lol')
|
|
meter2.setPos(716, 1092, 146)
|
|
meter2.setHpr(100,0,0)
|
|
|
|
#Stairs
|
|
|
|
#Textures
|