events.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  1. __filename__ = "events.py"
  2. __author__ = "Bob Mottram"
  3. __credits__ = ["Bartek Radwanski"]
  4. __license__ = "AGPL3+"
  5. __version__ = "1.0.0"
  6. __maintainer__ = "Bob Mottram"
  7. __email__ = "bob@freedombone.net"
  8. __status__ = "Production"
  9. from functions import str2bool
  10. from functions import getFreeKey
  11. from functions import sizeFromDescription
  12. import time
  13. '''
  14. ## Function template
  15. def (etarget, ebody, players, npcs, items, env):
  16. players[etarget]
  17. '''
  18. def setPlayerCanGo(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  19. if etarget in players:
  20. players[etarget]['canGo'] = int(ebody)
  21. def setPlayerCanLook(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  22. if etarget in players:
  23. players[etarget]['canLook'] = int(ebody)
  24. def setPlayerCanSay(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  25. if etarget in players:
  26. players[etarget]['canSay'] = int(ebody)
  27. def setPlayerCanAttack(
  28. etarget,
  29. ebody,
  30. players,
  31. npcs,
  32. items,
  33. env,
  34. npcsDB,
  35. envDB):
  36. if etarget in players:
  37. players[etarget]['canAttack'] = int(ebody)
  38. def setPlayerCanDirectMessage(
  39. etarget,
  40. ebody,
  41. players,
  42. npcs,
  43. items,
  44. env,
  45. npcsDB,
  46. envDB):
  47. if etarget in players:
  48. players[etarget]['canDirectMessage'] = int(ebody)
  49. def setPlayerPrefix(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  50. if etarget in players:
  51. players[etarget]['prefix'] = str(ebody)
  52. def setPlayerName(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  53. players[etarget]['name'] = str(ebody)
  54. def setPlayerRoom(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  55. players[etarget]['room'] = str(ebody)
  56. def setPlayerLvl(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  57. players[etarget]['lvl'] = int(ebody)
  58. def modPlayerLvl(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  59. players[etarget]['lvl'] += int(ebody)
  60. def setPlayerExp(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  61. players[etarget]['exp'] = int(ebody)
  62. def modPlayerExp(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  63. players[etarget]['exp'] += int(ebody)
  64. def setPlayerStr(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  65. players[etarget]['str'] = int(ebody)
  66. def modPlayerStr(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  67. players[etarget]['str'] += int(ebody)
  68. def setPlayerSiz(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  69. players[etarget]['siz'] = int(ebody)
  70. def modPlayerSiz(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  71. players[etarget]['siz'] += int(ebody)
  72. def setPlayerWei(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  73. players[etarget]['wei'] = int(ebody)
  74. def modPlayerWei(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  75. players[etarget]['wei'] += int(ebody)
  76. def setPlayerPer(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  77. players[etarget]['per'] = int(ebody)
  78. def modPlayerPer(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  79. players[etarget]['per'] += int(ebody)
  80. def setPlayerCool(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  81. players[etarget]['cool'] = int(ebody)
  82. def modPlayerCool(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  83. players[etarget]['cool'] += int(ebody)
  84. def setPlayerEndu(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  85. players[etarget]['endu'] = int(ebody)
  86. def modPlayerEndu(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  87. players[etarget]['endu'] += int(ebody)
  88. def setPlayerCha(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  89. players[etarget]['cha'] = int(ebody)
  90. def modPlayerCha(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  91. players[etarget]['cha'] += int(ebody)
  92. def setPlayerInt(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  93. players[etarget]['inte'] = int(ebody)
  94. def modPlayerInt(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  95. players[etarget]['inte'] += int(ebody)
  96. def setPlayerAgi(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  97. players[etarget]['agi'] = int(ebody)
  98. def modPlayerAgi(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  99. players[etarget]['agi'] += int(ebody)
  100. def setPlayerLuc(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  101. players[etarget]['luc'] = int(ebody)
  102. def modPlayerLuc(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  103. players[etarget]['luc'] += int(ebody)
  104. def setPlayerCred(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  105. players[etarget]['cred'] = int(ebody)
  106. def modPlayerCred(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  107. players[etarget]['cred'] += int(ebody)
  108. def setPlayerInv(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  109. players[etarget]['inv'] = str(ebody)
  110. def setAuthenticated(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  111. players[etarget]['authenticated'] = str2bool(ebody)
  112. def setPlayerClo_head(
  113. etarget,
  114. ebody,
  115. players,
  116. npcs,
  117. items,
  118. env,
  119. npcsDB,
  120. envDB):
  121. tempVar = 0
  122. def setPlayerClo_neck(
  123. etarget,
  124. ebody,
  125. players,
  126. npcs,
  127. items,
  128. env,
  129. npcsDB,
  130. envDB):
  131. tempVar = 0
  132. def setPlayerClo_lwrist(
  133. etarget,
  134. ebody,
  135. players,
  136. npcs,
  137. items,
  138. env,
  139. npcsDB,
  140. envDB):
  141. tempVar = 0
  142. def setPlayerClo_rwrist(
  143. etarget,
  144. ebody,
  145. players,
  146. npcs,
  147. items,
  148. env,
  149. npcsDB,
  150. envDB):
  151. tempVar = 0
  152. def setPlayerClo_larm(
  153. etarget,
  154. ebody,
  155. players,
  156. npcs,
  157. items,
  158. env,
  159. npcsDB,
  160. envDB):
  161. tempVar = 0
  162. def setPlayerClo_rarm(
  163. etarget,
  164. ebody,
  165. players,
  166. npcs,
  167. items,
  168. env,
  169. npcsDB,
  170. envDB):
  171. tempVar = 0
  172. def setPlayerClo_lhand(
  173. etarget,
  174. ebody,
  175. players,
  176. npcs,
  177. items,
  178. env,
  179. npcsDB,
  180. envDB):
  181. tempVar = 0
  182. def setPlayerClo_rhand(
  183. etarget,
  184. ebody,
  185. players,
  186. npcs,
  187. items,
  188. env,
  189. npcsDB,
  190. envDB):
  191. tempVar = 0
  192. def setPlayerClo_chest(
  193. etarget,
  194. ebody,
  195. players,
  196. npcs,
  197. items,
  198. env,
  199. npcsDB,
  200. envDB):
  201. tempVar = 0
  202. def setPlayerClo_lleg(
  203. etarget,
  204. ebody,
  205. players,
  206. npcs,
  207. items,
  208. env,
  209. npcsDB,
  210. envDB):
  211. tempVar = 0
  212. def setPlayerClo_rleg(
  213. etarget,
  214. ebody,
  215. players,
  216. npcs,
  217. items,
  218. env,
  219. npcsDB,
  220. envDB):
  221. tempVar = 0
  222. def setPlayerClo_feet(
  223. etarget,
  224. ebody,
  225. players,
  226. npcs,
  227. items,
  228. env,
  229. npcsDB,
  230. envDB):
  231. tempVar = 0
  232. def setPlayerImp_head(
  233. etarget,
  234. ebody,
  235. players,
  236. npcs,
  237. items,
  238. env,
  239. npcsDB,
  240. envDB):
  241. tempVar = 0
  242. def setPlayerImp_larm(
  243. etarget,
  244. ebody,
  245. players,
  246. npcs,
  247. items,
  248. env,
  249. npcsDB,
  250. envDB):
  251. tempVar = 0
  252. def setPlayerImp_rarm(
  253. etarget,
  254. ebody,
  255. players,
  256. npcs,
  257. items,
  258. env,
  259. npcsDB,
  260. envDB):
  261. tempVar = 0
  262. def setPlayerImp_lhand(
  263. etarget,
  264. ebody,
  265. players,
  266. npcs,
  267. items,
  268. env,
  269. npcsDB,
  270. envDB):
  271. tempVar = 0
  272. def setPlayerImp_rhand(
  273. etarget,
  274. ebody,
  275. players,
  276. npcs,
  277. items,
  278. env,
  279. npcsDB,
  280. envDB):
  281. tempVar = 0
  282. def setPlayerImp_chest(
  283. etarget,
  284. ebody,
  285. players,
  286. npcs,
  287. items,
  288. env,
  289. npcsDB,
  290. envDB):
  291. tempVar = 0
  292. def setPlayerImp_lleg(
  293. etarget,
  294. ebody,
  295. players,
  296. npcs,
  297. items,
  298. env,
  299. npcsDB,
  300. envDB):
  301. tempVar = 0
  302. def setPlayerImp_rleg(
  303. etarget,
  304. ebody,
  305. players,
  306. npcs,
  307. items,
  308. env,
  309. npcsDB,
  310. envDB):
  311. tempVar = 0
  312. def setPlayerImp_feet(
  313. etarget,
  314. ebody,
  315. players,
  316. npcs,
  317. items,
  318. env,
  319. npcsDB,
  320. envDB):
  321. tempVar = 0
  322. def setPlayerHp(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  323. players[etarget]['hp'] = int(ebody)
  324. def modPlayerHp(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  325. players[etarget]['hp'] += int(ebody)
  326. def setPlayerCharge(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  327. players[etarget]['charge'] = int(ebody)
  328. def modPlayerCharge(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  329. players[etarget]['charge'] += int(ebody)
  330. def setPlayerIsInCombat(
  331. etarget,
  332. ebody,
  333. players,
  334. npcs,
  335. items,
  336. env,
  337. npcsDB,
  338. envDB):
  339. players[etarget]['isInCombat'] += int(ebody)
  340. def setPlayerLastCombatAction(
  341. etarget,
  342. ebody,
  343. players,
  344. npcs,
  345. items,
  346. env,
  347. npcsDB,
  348. envDB):
  349. players[etarget]['lastCombatAction'] = int(ebody)
  350. def modPlayerLastCombatAction(
  351. etarget,
  352. ebody,
  353. players,
  354. npcs,
  355. items,
  356. env,
  357. npcsDB,
  358. envDB):
  359. players[etarget]['lastCombatAction'] += int(ebody)
  360. def setPlayerIsAttackable(
  361. etarget,
  362. ebody,
  363. players,
  364. npcs,
  365. items,
  366. env,
  367. npcsDB,
  368. envDB):
  369. players[etarget]['isAttackable'] = int(ebody)
  370. def setPlayerLastRoom(
  371. etarget,
  372. ebody,
  373. players,
  374. npcs,
  375. items,
  376. env,
  377. npcsDB,
  378. envDB):
  379. players[etarget]['lastRoom'] = str(ebody)
  380. def setPlayerCorpseTTL(
  381. etarget,
  382. ebody,
  383. players,
  384. npcs,
  385. items,
  386. env,
  387. npcsDB,
  388. envDB):
  389. players[etarget]['corpseTTL'] = int(ebody)
  390. def modPlayerCorpseTTL(
  391. etarget,
  392. ebody,
  393. players,
  394. npcs,
  395. items,
  396. env,
  397. npcsDB,
  398. envDB):
  399. players[etarget]['corpseTTL'] += int(ebody)
  400. def itemInRoom(items, id, room):
  401. for i in items.items():
  402. if i[1]['room'] == room:
  403. if id == i[1]['id']:
  404. return True
  405. return False
  406. def spawnItem(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  407. tempVar = 0
  408. body = ebody.split(';')
  409. if not itemInRoom(items, int(body[0]), body[1]):
  410. items[getFreeKey(items,
  411. 200000)] = {'id': int(body[0]),
  412. 'room': body[1],
  413. 'whenDropped': int(time.time()),
  414. 'lifespan': int(body[2]),
  415. 'owner': int(body[3])}
  416. def npcExists(npcs, name):
  417. for n in npcs.items():
  418. if name in n[1]['name']:
  419. return True
  420. return False
  421. def spawnNPC(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  422. tempVar = 0
  423. body = ebody.split(';')
  424. # print(npcsDB)
  425. # print(body)
  426. # print(ebody)
  427. # if the size is unknown then estimate it
  428. if npcsDB[int(body[0])]['siz'] == 0:
  429. npcsDB[int(body[0])]['siz'] = sizeFromDescription(
  430. npcsDB[int(body[0])]['name'] + ' ' + npcsDB[int(body[0])]['lookDescription'])
  431. if not npcExists(npcs, npcsDB[int(body[0])]['name']):
  432. npcs[getFreeKey(npcs,
  433. 90000)] = {'name': npcsDB[int(body[0])]['name'],
  434. 'room': body[1],
  435. 'lvl': npcsDB[int(body[0])]['lvl'],
  436. 'exp': npcsDB[int(body[0])]['exp'],
  437. 'str': npcsDB[int(body[0])]['str'],
  438. 'siz': npcsDB[int(body[0])]['siz'],
  439. 'wei': npcsDB[int(body[0])]['wei'],
  440. 'per': npcsDB[int(body[0])]['per'],
  441. 'endu': npcsDB[int(body[0])]['endu'],
  442. 'cha': npcsDB[int(body[0])]['cha'],
  443. 'int': npcsDB[int(body[0])]['int'],
  444. 'agi': npcsDB[int(body[0])]['agi'],
  445. 'follow': npcsDB[int(body[0])]['follow'],
  446. 'bodyType': npcsDB[int(body[0])]['bodyType'],
  447. 'canWear': npcsDB[int(body[0])]['canWear'],
  448. 'canWield': npcsDB[int(body[0])]['canWield'],
  449. 'luc': npcsDB[int(body[0])]['luc'],
  450. 'cool': npcsDB[int(body[0])]['cool'],
  451. 'ref': npcsDB[int(body[0])]['ref'],
  452. 'cred': npcsDB[int(body[0])]['cred'],
  453. 'inv': npcsDB[int(body[0])]['inv'],
  454. 'speakLanguage': npcsDB[int(body[0])]['speakLanguage'],
  455. 'language': npcsDB[int(body[0])]['language'],
  456. 'conv': npcsDB[int(body[0])]['conv'],
  457. 'path': npcsDB[int(body[0])]['path'],
  458. 'moveDelay': npcsDB[int(body[0])]['moveDelay'],
  459. 'moveType': npcsDB[int(body[0])]['moveType'],
  460. 'moveTimes': npcsDB[int(body[0])]['moveTimes'],
  461. 'isAttackable': int(body[2]),
  462. 'isStealable': int(body[3]),
  463. 'isKillable': int(body[4]),
  464. 'isAggressive': int(body[5]),
  465. 'clo_head': npcsDB[int(body[0])]['clo_head'],
  466. 'clo_neck': npcsDB[int(body[0])]['clo_neck'],
  467. 'clo_lwrist': npcsDB[int(body[0])]['clo_lwrist'],
  468. 'clo_rwrist': npcsDB[int(body[0])]['clo_rwrist'],
  469. 'clo_larm': npcsDB[int(body[0])]['clo_larm'],
  470. 'clo_rarm': npcsDB[int(body[0])]['clo_rarm'],
  471. 'clo_lhand': npcsDB[int(body[0])]['clo_lhand'],
  472. 'clo_rhand': npcsDB[int(body[0])]['clo_rhand'],
  473. 'clo_chest': npcsDB[int(body[0])]['clo_chest'],
  474. 'clo_lleg': npcsDB[int(body[0])]['clo_lleg'],
  475. 'clo_rleg': npcsDB[int(body[0])]['clo_rleg'],
  476. 'clo_feet': npcsDB[int(body[0])]['clo_feet'],
  477. 'imp_head': npcsDB[int(body[0])]['imp_head'],
  478. 'imp_larm': npcsDB[int(body[0])]['imp_larm'],
  479. 'imp_rarm': npcsDB[int(body[0])]['imp_rarm'],
  480. 'imp_lhand': npcsDB[int(body[0])]['imp_lhand'],
  481. 'imp_rhand': npcsDB[int(body[0])]['imp_rhand'],
  482. 'imp_chest': npcsDB[int(body[0])]['imp_chest'],
  483. 'imp_lleg': npcsDB[int(body[0])]['imp_lleg'],
  484. 'imp_rleg': npcsDB[int(body[0])]['imp_rleg'],
  485. 'imp_feet': npcsDB[int(body[0])]['imp_feet'],
  486. 'hp': npcsDB[int(body[0])]['hp'],
  487. 'hpMax': npcsDB[int(body[0])]['hpMax'],
  488. 'charge': npcsDB[int(body[0])]['charge'],
  489. 'corpseTTL': int(body[6]),
  490. 'respawn': int(body[7]),
  491. 'vocabulary': npcsDB[int(body[0])]['vocabulary'],
  492. 'talkDelay': npcsDB[int(body[0])]['talkDelay'],
  493. 'inDescription': npcsDB[int(body[0])]['inDescription'],
  494. 'outDescription': npcsDB[int(body[0])]['outDescription'],
  495. 'lookDescription': npcsDB[int(body[0])]['lookDescription'],
  496. 'timeTalked': 0,
  497. 'isInCombat': 0,
  498. 'lastCombatAction': 0,
  499. 'lastRoom': None,
  500. 'whenDied': None,
  501. 'randomizer': 0,
  502. 'randomFactor': npcsDB[int(body[0])]['randomFactor'],
  503. 'lastSaid': 0,
  504. 'lastMoved': 0,
  505. 'race': npcsDB[int(body[0])]['race'],
  506. 'characterClass': npcsDB[int(body[0])]['characterClass'],
  507. 'proficiencies': npcsDB[int(body[0])]['proficiencies'],
  508. 'fightingStyle': npcsDB[int(body[0])]['fightingStyle'],
  509. 'restRequired': npcsDB[int(body[0])]['restRequired'],
  510. 'enemy': npcsDB[int(body[0])]['enemy'],
  511. 'tempCharm': npcsDB[int(body[0])]['tempCharm'],
  512. 'tempCharmTarget': npcsDB[int(body[0])]['tempCharmTarget'],
  513. 'tempCharmDuration': npcsDB[int(body[0])]['tempCharmDuration'],
  514. 'tempCharmStart': npcsDB[int(body[0])]['tempCharmStart'],
  515. 'guild': npcsDB[int(body[0])]['guild'],
  516. 'guildRole': npcsDB[int(body[0])]['guildRole'],
  517. 'archetype': npcsDB[int(body[0])]['archetype'],
  518. 'preparedSpells': npcsDB[int(body[0])]['preparedSpells'],
  519. 'spellSlots': npcsDB[int(body[0])]['spellSlots'],
  520. 'tempHitPoints': npcsDB[int(body[0])]['tempHitPoints'],
  521. 'tempHitPointsStart': npcsDB[int(body[0])]['tempHitPointsStart'],
  522. 'tempHitPointsDuration': npcsDB[int(body[0])]['tempHitPointsDuration'],
  523. 'frozenDuration': npcsDB[int(body[0])]['frozenDuration'],
  524. 'frozenStart': npcsDB[int(body[0])]['frozenStart'],
  525. 'frozenDescription': npcsDB[int(body[0])]['frozenDescription'],
  526. 'affinity': npcsDB[int(body[0])]['affinity'],
  527. 'familiar': npcsDB[int(body[0])]['familiar'],
  528. 'familiarOf': npcsDB[int(body[0])]['familiarOf'],
  529. 'familiarTarget': npcsDB[int(body[0])]['familiarTarget'],
  530. 'familiarType': npcsDB[int(body[0])]['familiarType'],
  531. 'familiarMode': npcsDB[int(body[0])]['familiarMode'],
  532. 'animalType': npcsDB[int(body[0])]['animalType']}
  533. def actorInRoom(env, name, room):
  534. for e in env.items():
  535. if room == e[1]['room']:
  536. if name in e[1]['name']:
  537. return True
  538. return False
  539. def spawnActor(etarget, ebody, players, npcs, items, env, npcsDB, envDB):
  540. tempVar = 0
  541. body = ebody.split(';')
  542. if not actorInRoom(env, envDB[int(body[0])]['name'], body[1]):
  543. env[int(body[0])] = {'name': envDB[int(body[0])]['name'],
  544. 'vocabulary': envDB[int(body[0])]['vocabulary'],
  545. 'talkDelay': envDB[int(body[0])]['talkDelay'],
  546. 'randomFactor': envDB[int(body[0])]['randomFactor'],
  547. 'room': body[1],
  548. 'randomizer': envDB[int(body[0])]['randomizer'],
  549. 'timeTalked': envDB[int(body[0])]['timeTalked'],
  550. 'lastSaid': envDB[int(body[0])]['lastSaid']}
  551. # Function for evaluating an Event
  552. def evaluateEvent(
  553. etarget,
  554. etype,
  555. ebody,
  556. players,
  557. npcs,
  558. items,
  559. env,
  560. npcsDB,
  561. envDB):
  562. switcher = {
  563. "setPlayerCanGo": setPlayerCanGo,
  564. "setPlayerCanLook": setPlayerCanLook,
  565. "setPlayerCanSay": setPlayerCanSay,
  566. "setPlayerCanAttack": setPlayerCanAttack,
  567. "setPlayerCanDirectMessage": setPlayerCanDirectMessage,
  568. "setPlayerName": setPlayerName,
  569. "setPlayerPrefix": setPlayerPrefix,
  570. "setPlayerRoom": setPlayerRoom,
  571. "setPlayerLvl": setPlayerLvl,
  572. "modPlayerLvl": modPlayerLvl,
  573. "setPlayerExp": setPlayerExp,
  574. "modPlayerExp": modPlayerExp,
  575. "setPlayerStr": setPlayerStr,
  576. "modPlayerStr": modPlayerStr,
  577. "setPlayerSiz": setPlayerSiz,
  578. "modPlayerSiz": modPlayerSiz,
  579. "setPlayerWei": setPlayerWei,
  580. "modPlayerWei": modPlayerWei,
  581. "setPlayerPer": setPlayerPer,
  582. "modPlayerPer": modPlayerPer,
  583. "setPlayerCool": setPlayerCool,
  584. "modPlayerCool": modPlayerCool,
  585. "setPlayerEndu": setPlayerEndu,
  586. "modPlayerEndu": modPlayerEndu,
  587. "setPlayerCha": setPlayerCha,
  588. "modPlayerCha": modPlayerCha,
  589. "setPlayerInt": setPlayerInt,
  590. "modPlayerInt": modPlayerInt,
  591. "setPlayerAgi": setPlayerAgi,
  592. "modPlayerAgi": modPlayerAgi,
  593. "setPlayerLuc": setPlayerLuc,
  594. "modPlayerLuc": modPlayerLuc,
  595. "setPlayerCred": setPlayerCred,
  596. "modPlayerCred": modPlayerCred,
  597. "setPlayerInv": setPlayerInv,
  598. "setAuthenticated": setAuthenticated,
  599. "setPlayerClo_head": setPlayerClo_head,
  600. "setPlayerClo_neck": setPlayerClo_neck,
  601. "setPlayerClo_larm": setPlayerClo_larm,
  602. "setPlayerClo_rarm": setPlayerClo_rarm,
  603. "setPlayerClo_lhand": setPlayerClo_lhand,
  604. "setPlayerClo_rhand": setPlayerClo_rhand,
  605. "setPlayerClo_lwrist": setPlayerClo_lwrist,
  606. "setPlayerClo_rwrist": setPlayerClo_rwrist,
  607. "setPlayerClo_chest": setPlayerClo_chest,
  608. "setPlayerClo_lleg": setPlayerClo_lleg,
  609. "setPlayerClo_rleg": setPlayerClo_rleg,
  610. "setPlayerClo_feet": setPlayerClo_feet,
  611. "setPlayerImp_head": setPlayerImp_head,
  612. "setPlayerImp_larm": setPlayerImp_larm,
  613. "setPlayerImp_rarm": setPlayerImp_rarm,
  614. "setPlayerImp_lhand": setPlayerImp_lhand,
  615. "setPlayerImp_rhand": setPlayerImp_rhand,
  616. "setPlayerImp_chest": setPlayerImp_chest,
  617. "setPlayerImp_lleg": setPlayerImp_lleg,
  618. "setPlayerImp_rleg": setPlayerImp_rleg,
  619. "setPlayerImp_feet": setPlayerImp_feet,
  620. "setPlayerHp": setPlayerHp,
  621. "modPlayerHp": modPlayerHp,
  622. "setPlayerCharge": setPlayerCharge,
  623. "modPlayerCharge": modPlayerCharge,
  624. "setPlayerIsInCombat": setPlayerIsInCombat,
  625. "setPlayerLastCombatAction": setPlayerLastCombatAction,
  626. "modPlayerLastCombatAction": modPlayerLastCombatAction,
  627. "setPlayerIsAttackable": setPlayerIsAttackable,
  628. "setPlayerLastRoom": setPlayerLastRoom,
  629. "setPlayerCorpseTTL": setPlayerCorpseTTL,
  630. "modPlayerCorpseTTL": modPlayerCorpseTTL,
  631. "spawnItem": spawnItem,
  632. "spawnNPC": spawnNPC,
  633. "spawnActor": spawnActor,
  634. }
  635. switcher[etype](etarget, ebody, players, npcs, items, env, npcsDB, envDB)