Advertisement
Ramaraunt1

Untitled

Apr 30th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.65 KB | None | 0 0
  1. #RAMARAUNT SCIPT OSP BEGIN
  2.  
  3. ("cf_bank_withdraw_in_database", #SERVER: attempt a bank withdrawl (actual money changes are done in script_game_receive_url_response).
  4. [(store_script_param, ":player_id", 1),
  5. (player_get_unique_id, reg90, ":player_id"),
  6. (assign, reg91, bank_gold_withdraw_amount),
  7.  
  8. #now lets build the string and send it!
  9. (str_store_string, s100, "str_name_server"),
  10. (str_store_string, s101, "str_name_server_password"),
  11. (send_message_to_url, "@{s100}banksub.php?guid={reg90}&amount={reg91}&password={s101}"),
  12. ]),
  13.  
  14. ("cf_bank_deposit_in_database", #SERVER: attempt a bank deposit (actual money changes are done in script_game_receive_url_response).
  15. [(store_script_param, ":player_id", 1),
  16. (player_get_unique_id, reg90, ":player_id"),
  17. (player_get_gold, ":gold", ":player_id"),
  18. (try_begin),
  19. (eq, ":gold", 0),
  20. (str_store_string, s90, "@You have no gold to deposit!"),
  21. (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s90),
  22. (try_end),
  23. (neq, ":gold", 0),
  24. (try_begin),
  25. (ge, ":gold", bank_gold_deposit_amount),
  26. (assign, reg91, 5000),
  27. (else_try),
  28. (assign, reg91, ":gold"),
  29. (try_end),
  30.  
  31. #now lets build the string and send it!
  32. (str_store_string, s100, "str_name_server"),
  33. (str_store_string, s101, "str_name_server_password"),
  34. (send_message_to_url, "@{s100}bankadd.php?guid={reg90}&amount={reg91}&password={s101}"),
  35. ]),
  36.  
  37. ("player_leave_in_database", #SERVER: send player guid to database to say he/she has left the server.
  38. [(store_script_param, ":player_id", 1),
  39. (player_get_unique_id, reg90, ":player_id"),
  40.  
  41. #now lets build the string and send it!
  42. (str_store_string, s100, "str_name_server"),
  43. (str_store_string, s101, "str_name_server_password"),
  44. (send_message_to_url, "@{s100}playerleave.php?guid={reg90}&password={s101}"),
  45. ]),
  46.  
  47. ("player_join_in_database", #SERVER: send player guid to database to say he/she has joined.
  48. [(store_script_param, ":player_id", 1),
  49. (player_get_unique_id, reg90, ":player_id"),
  50.  
  51. #now lets build the string and send it!
  52. (str_store_string, s100, "str_name_server"),
  53. (str_store_string, s101, "str_name_server_password"),
  54. (send_message_to_url, "@{s100}playerjoin.php?guid={reg90}&password={s101}"),
  55. ]),
  56.  
  57. ("check_player_name_in_database", #SERVER: send a player name and guid to the database to check if it is allowed RAMARAUNT SCRIPT
  58. [(store_script_param, ":player_id", 1),
  59. (str_store_player_username, s90, ":player_id"),
  60. (player_get_unique_id, reg90, ":player_id"),
  61.  
  62. #now lets build the string and send it!
  63. (str_store_string, s100, "str_name_server"),
  64. (str_store_string, s101, "str_name_server_password"),
  65. (send_message_to_url, "@{s100}namecheck.php?guid={reg90}&password={s101}&name={s90}"),
  66. ]),
  67.  
  68. ("cf_save_player_in_database", #SERVER: save a player to the database on the webserver RAMARAUNT SCRIPT
  69. [(store_script_param, ":player_id", 1),
  70.  
  71. #CHECK IF ELIGABLE
  72. (player_is_active, ":player_id"),
  73. (player_get_agent_id, ":agent_id", ":player_id"),
  74. (agent_is_alive, ":agent_id"),
  75. (agent_is_human, ":agent_id"), #in case some wierd mod uses this without humans... *COUGH*illuminati*COUGH* :D
  76.  
  77. #GET DATA
  78. (player_get_unique_id, reg90, ":player_id"),
  79. (agent_get_item_slot, reg91, ":agent_id", 4),
  80. (agent_get_item_slot, reg92, ":agent_id", 5),
  81. (agent_get_item_slot, reg93, ":agent_id", 7),
  82. (agent_get_item_slot, reg94, ":agent_id", 6),
  83. (agent_get_horse, ":horse_agent_id", ":agent_id"),
  84. (agent_get_item_id, reg95, ":horse_agent_id"),
  85. (store_agent_hit_points, reg96, ":horse_agent_id", 1),
  86. (agent_get_item_slot, reg97, ":agent_id", 0),
  87. (agent_get_item_slot, reg98, ":agent_id", 1),
  88. (agent_get_item_slot, reg99, ":agent_id", 2),
  89. (agent_get_item_slot, reg100, ":agent_id", 3),
  90. (store_agent_hit_points, reg101, ":agent_id", 1),
  91. (agent_get_slot, reg102, ":agent_id", slot_agent_food_amount),
  92. (player_get_gold, reg103, ":player_id"),
  93. (agent_get_position, pos4, ":agent_id"),
  94. (position_get_x, reg104, pos4),
  95. (position_get_y, reg105, pos4),
  96. (position_get_z, reg106, pos4),
  97. (agent_get_troop_id, reg107, ":agent_id"),
  98. (player_get_slot, reg108, ":player_id", slot_player_faction_id),
  99.  
  100. #now lets build the string and send it!
  101. (str_store_string, s100, "str_name_server"),
  102. (str_store_string, s101, "str_name_server_password"),
  103. (send_message_to_url, "@{s100}playersave.php?guid={reg90}&password={s101}&head={reg91}&body={reg92}&hand={reg93}&foot={reg94}&horse={reg95}&horse_health={reg96}&slot1={reg97}&slot2={reg98}&slot3={reg99}&slot4={reg100}&health={reg101}&hunger={reg102}&player_gold={reg103}&posx={reg104}&posy={reg105}&posz={reg106}&troop={reg107}&faction={reg108}"),
  104. ]),
  105.  
  106. ("game_receive_url_response", # called by the game when a response is received from a web server, if used in a custom module system, DELETE ON THERE AND REPLACE WITH THIS
  107. [(store_script_param, ":integer_count", 1),
  108. (store_script_param, ":string_count", 2),
  109.  
  110. (try_begin),
  111. (ge, ":integer_count", 1),
  112. (try_begin),
  113. (eq, reg1, 1), #uhoh, the player doesnt exist in the database. lets make him/her.
  114. (assign, ":player_guid", reg2),
  115. (str_store_string, s90, "str_name_server"),
  116. (str_store_string, s91, "str_name_server_password"),
  117. (try_for_players, ":cur_player"),
  118. (player_get_unique_id, ":cur_guid", ":cur_player"),
  119. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  120. (player_get_agent_id, ":cur_agent", ":cur_player"),
  121. (agent_get_position, pos2, ":cur_agent"),
  122. (position_get_x, reg90, pos2),
  123. (position_get_y, reg91, pos2),
  124. (position_get_z, reg92, pos2),
  125. (player_get_gold, reg93, ":cur_player"),
  126. #now lets build the string and send it!
  127. (str_store_string, s100, "str_name_server"),
  128. (str_store_string, s101, "str_name_server_password"),
  129. (send_message_to_url, "@{s100}accountcreate.php?guid={reg2}&posx={reg90}&posy={reg91}&posz={reg92}&player_gold={reg93}&password={s101}"),
  130. (try_end),
  131. (else_try),
  132. (eq, reg1, 2),#We just recieved orders from the webserver to change a player's loadout. Lets do it!
  133. (assign, ":player_guid", reg2),
  134. (assign, ":head", reg3),
  135. (assign, ":body", reg4),
  136. (assign, ":hand", reg5),
  137. (assign, ":foot", reg6),
  138. (assign, ":horse", reg7),
  139. (assign, ":horse_health", reg8),
  140. (assign, ":slot1", reg9),
  141. (assign, ":slot2", reg10),
  142. (assign, ":slot3", reg11),
  143. (assign, ":slot4", reg12),
  144. (assign, ":health", reg13),
  145. (assign, ":hunger", reg14),
  146. (assign, ":player_gold", reg15),
  147. #(assign, ":bank_gold", reg16), #don't need this
  148. (assign, ":posx", reg17),
  149. (assign, ":posy", reg18),
  150. (assign, ":posz", reg19),
  151. #(assign, ":banned_yes", reg20), #nor this
  152. (assign, ":admin_level", reg21),
  153. (assign, ":troop", reg22),
  154. (assign, ":faction", reg23),
  155. (try_for_players, ":cur_player"),
  156. (player_get_unique_id, ":cur_guid", ":cur_player"),
  157. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  158. (player_get_agent_id, ":cur_agent", ":cur_player"),
  159.  
  160. # _ _ _
  161. # _ __ ___ ___(_) |_(_) ___ _ __
  162. # | '_ \ / _ \/ __| | __| |/ _ \| '_ \
  163. # | |_) | (_) \__ \ | |_| | (_) | | | |
  164. # | .__/ \___/|___/_|\__|_|\___/|_| |_|
  165. # |_|
  166. #
  167.  
  168. (try_begin),
  169. (init_position, pos99),
  170. (position_set_x, pos99, ":posx"),
  171. (position_set_y, pos99, ":posy"),
  172. (position_set_z, pos99, ":posz"),
  173. (agent_set_position, ":cur_agent", pos99),
  174. (try_end),
  175.  
  176. # _____
  177. # /__ \_ __ ___ ___ _ __
  178. # / /\/ '__/ _ \ / _ \| '_ \
  179. # / / | | | (_) | (_) | |_) |
  180. # \/ |_| \___/ \___/| .__/
  181. # |_|
  182.  
  183. (try_begin),
  184. (neq, ":troop", -1),
  185. (player_set_troop_id,":troop", ":cur_player"),
  186. (try_end),
  187.  
  188. # __ _ _
  189. # / _| __ _ ___| |_(_) ___ _ __
  190. # | |_ / _` |/ __| __| |/ _ \| '_ \
  191. # | _| (_| | (__| |_| | (_) | | | |
  192. # |_| \__,_|\___|\__|_|\___/|_| |_|
  193. #
  194.  
  195. (try_begin),
  196. (neq, ":faction", -1),
  197. (call_script, "script_change_faction", ":cur_player", ":faction", change_faction_type_no_respawn),
  198. (try_end),
  199.  
  200. # _
  201. # /_\ _ __ _ __ ___ ___ _ __
  202. # //_\\| '__| '_ ` _ \ / _ \| '__|
  203. # / _ \ | | | | | | | (_) | |
  204. # \_/ \_/_| |_| |_| |_|\___/|_|
  205. #
  206.  
  207. (try_begin),
  208. (neq, ":head", -1),
  209. (agent_equip_item, ":cur_agent", ":head"),
  210. (try_end),
  211. (try_begin),
  212. (neq, ":body", -1),
  213. (agent_equip_item, ":cur_agent", ":body"),
  214. (try_end),
  215. (try_begin),
  216. (neq, ":feet", -1),
  217. (agent_equip_item, ":cur_agent", ":feet"),
  218. (try_end),
  219. (try_begin),
  220. (neq, ":hands", -1),
  221. (agent_equip_item, ":hands", ":head"),
  222. (try_end),
  223.  
  224. # __ __
  225. # / \ / \ ____ _____ ______ ____ ____ ______
  226. # \ \/\/ // __ \\__ \ \____ \ / _ \ / \ / ___/
  227. # \ /\ ___/ / __ \| |_> > <_> ) | \\___ \
  228. # \__/\ / \___ >____ / __/ \____/|___| /____ >
  229. # \/ \/ \/|__| \/ \/
  230. #
  231.  
  232. (try_begin),
  233. (neq, ":slot1", -1),
  234. (agent_equip_item, ":cur_agent", ":slot1", 1),
  235. (try_end),
  236. (try_begin),
  237. (neq, ":slot2", -1),
  238. (agent_equip_item, ":cur_agent", ":slot2", 2),
  239. (try_end),
  240. (try_begin),
  241. (neq, ":slot3", -1),
  242. (agent_equip_item, ":cur_agent", ":slot3", 3),
  243. (try_end),
  244. (try_begin),
  245. (neq, ":slot4", -1),
  246. (agent_equip_item, ":cur_agent", ":slot4", 4),
  247. (try_end),
  248.  
  249. # ___ ___
  250. # / | \ ___________ ______ ____
  251. # / ~ \/ _ \_ __ \/ ___// __ \
  252. # \ Y ( <_> ) | \/\___ \\ ___/
  253. # \___|_ / \____/|__| /____ >\___ >
  254. # \/ \/ \/
  255.  
  256. (try_begin),
  257. (neq, ":horse", -1),
  258. (position_move_x, pos4, 50),
  259. (position_set_z_to_ground_level, pos4),
  260. (set_spawn_position, pos4),
  261. (spawn_horse, ":horse"),
  262. (neq, ":horse_health", 100),
  263. (agent_set_health, reg0, ":horse_health", 1),
  264. (try_end),
  265.  
  266. # ___ ___ .__ __ .__
  267. # / | \ ____ _____ | |_/ |_| |__
  268. # / ~ \_/ __ \\__ \ | |\ __\ | \
  269. # \ Y /\ ___/ / __ \| |_| | | Y \
  270. # \___|_ / \___ >____ /____/__| |___| /
  271. # \/ \/ \/ \/
  272.  
  273. (try_begin),
  274. (neq, ":health", -1),
  275. (agent_set_health, ":cur_agent", ":health", 1),
  276. (try_end),
  277.  
  278. # ___________ .___
  279. # \_ _____/___ ____ __| _/
  280. # | __)/ _ \ / _ \ / __ |
  281. # | \( <_> | <_> ) /_/ |
  282. # \___ / \____/ \____/\____ |
  283. # \/ \/
  284.  
  285. (try_begin),
  286. (neq, ":food", -1),
  287. (agent_set_slot, ":cur_agent", slot_agent_food_amount, ":food"),
  288. (multiplayer_send_3_int_to_player, ":cur_player", server_event_agent_set_slot, ":cur_agent", slot_agent_food_amount, ":food"),
  289. (try_end),
  290.  
  291. # _____ .___ .__
  292. # / _ \ __| _/_____ |__| ____
  293. # / /_\ \ / __ |/ \| |/ \
  294. # / | \/ /_/ | Y Y \ | | \
  295. # \____|__ /\____ |__|_| /__|___| /
  296. # \/ \/ \/ \/
  297.  
  298. (try_begin),
  299. (eq, ":admin_level", 0),
  300. (try_begin),
  301. (player_is_admin, ":cur_player"),
  302. (player_set_is_admin, ":cur_player", 0),
  303. (kick_player, ":cur_player"),
  304. (try_end),
  305. (try_end),
  306. (try_end),
  307. (else_try),
  308. (eq, reg1, 3),#Time to print the amount of gold in the player's bank in the client's local chat.
  309. (assign, ":player_guid", reg2),
  310. (assign, ":bank_gold", reg3),
  311. (str_store_string, s90, "@You have {reg3} gold left in your bank."),
  312. (try_for_players, ":cur_player"),
  313. (player_get_unique_id, ":cur_guid", ":cur_player"),
  314. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  315. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
  316. (try_end),
  317. (else_try),
  318. (eq, reg1, 4), #bank deposit was successful.
  319. (assign, ":player_guid", reg2),
  320. (str_store_string, s90, "@You deposit {reg3} gold."),
  321. (try_for_players, ":cur_player"),
  322. (player_get_unique_id, ":cur_guid", ":cur_player"),
  323. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  324. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
  325. (player_get_gold, ":gold", ":cur_player"),
  326. (val_sub, ":gold", reg3),
  327. (player_set_gold, ":cur_player", ":gold"),
  328. (try_end),
  329. (else_try),
  330. (eq, reg1, 5), #bank deposit was only partially successful, due to hitting the bank cap.
  331. (assign, ":player_guid", reg2),
  332. (assign, ":return_gold", reg3),
  333. (str_store_string, s90, "@You can only deposit {reg3} gold because you hit the bank cap of {reg4}"),
  334. (str_store_string, s91, "@You can no longer deposit gold, due to you hitting the bank cap of {reg4}"),
  335. (try_for_players, ":cur_player"),
  336. (player_get_unique_id, ":cur_guid", ":cur_player"),
  337. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  338. (try_begin),
  339. (gt, ":return_gold", 0),
  340. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
  341. (else_try),
  342. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s91),
  343. (try_end),
  344. (player_get_gold, ":gold", ":cur_player"),
  345. (val_sub, ":gold", reg3),
  346. (player_set_gold, ":cur_player", ":gold"),
  347. (try_end),
  348. (else_try),
  349. (eq, reg1, 6), #bank withrdaw was successful
  350. (assign, ":player_guid", reg2),
  351. (str_store_string, s90, "@You withdraw {reg4} gold."),
  352. (try_for_players, ":cur_player"),
  353. (player_get_unique_id, ":cur_guid", ":cur_player"),
  354. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  355. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
  356. (player_get_gold, ":gold", ":cur_player"),
  357. (val_add, ":gold", reg3),
  358. (player_set_gold, ":cur_player", ":gold"),
  359. (try_end),
  360. (else_try),
  361. (eq, reg1, 7), #bank witdraw was only partially successful, due to the bank becoming empty.
  362. (assign, ":player_guid", reg2),
  363. (assign, ":return_gold", reg3),
  364. (str_store_string, s90, "@You can only withdraw {reg3} gold because your bank is empty."),
  365. (str_store_string, s91, "@Your bank is empty, so you cannot withdraw any gold."),
  366. (try_for_players, ":cur_player"),
  367. (player_get_unique_id, ":cur_guid", ":cur_player"),
  368. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  369. (try_begin),
  370. (gt, ":return_gold", 0),
  371. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
  372. (else_try),
  373. (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s91),
  374. (try_end),
  375. (player_get_gold, ":gold", ":cur_player"),
  376. (val_add, ":gold", reg3),
  377. (player_set_gold, ":cur_player", ":gold"),
  378. (try_end),
  379. (else_try),
  380. (eq, reg1, 8), #kick player (due to invalid name)
  381. (assign, ":player_guid", reg2),
  382. (try_for_players, ":cur_player"),
  383. (player_get_unique_id, ":cur_guid", ":cur_player"),
  384. (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
  385. (neg|player_is_admin, ":cur_player"
  386. (kick_player, ":cur_player"),
  387. (try_end),
  388. (try_end),
  389. (try_end),
  390. ]),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement