-
Notifications
You must be signed in to change notification settings - Fork 0
/
Custom NPC notes.txt
41 lines (40 loc) · 1.35 KB
/
Custom NPC notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def createNpcsInZone(air, zoneId):
npcs = []
canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
npcIdList = zone2NpcDict.get(canonicalZoneId, [])
for npcId in npcIdList:
while npcIdList.count(npcId) > 1:
npcIdList.remove(npcId)
for i in xrange(len(npcIdList)):
npcId = npcIdList[i]
npcDesc = NPCToonDict.get(npcId)
if npcDesc[5] == NPC_FISHERMAN:
if not air.wantFishing:
continue
if npcDesc[5] == NPC_PARTYPERSON:
if not air.wantParties:
continue
if npcDesc[5] == NPC_SMART:
if not config.GetBool('want-talkative-tyler', False):
continue
npcs.append(createNPC(air, npcId, npcDesc, zoneId, posIndex=i))
return npcs
def npc(name, dnaType, gender, type):
import Toon
if npcId not in NPCToonDict:
return None
desc = NPCToonDict[npcId]
canonicalZoneId, name, dnaType, gender, protected, type = desc
npc = Toon.Toon()
npc.setName(name)
npc.setPickable(0)
npc.setPlayerType(NametagGlobals.CCNonPlayer)
dna = ToonDNA.ToonDNA()
if dnaType == 'r':
dnaList = getRandomDNA(npcId, gender)
else:
dnaList = dnaType
dna.newToonFromProperties(*dnaList)
npc.setDNAString(dna.makeNetString())
npc.animFSM.request('neutral')
return npc