Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RAMARAUNT SCIPT OSP BEGIN
- ("cf_bank_withdraw_in_database", #SERVER: attempt a bank withdrawl (actual money changes are done in script_game_receive_url_response).
- [(store_script_param, ":player_id", 1),
- (player_get_unique_id, reg90, ":player_id"),
- (assign, reg91, bank_gold_withdraw_amount),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}banksub.php?guid={reg90}&amount={reg91}&password={s101}"),
- ]),
- ("cf_bank_deposit_in_database", #SERVER: attempt a bank deposit (actual money changes are done in script_game_receive_url_response).
- [(store_script_param, ":player_id", 1),
- (player_get_unique_id, reg90, ":player_id"),
- (player_get_gold, ":gold", ":player_id"),
- (try_begin),
- (eq, ":gold", 0),
- (str_store_string, s90, "@You have no gold to deposit!"),
- (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s90),
- (try_end),
- (neq, ":gold", 0),
- (try_begin),
- (ge, ":gold", bank_gold_deposit_amount),
- (assign, reg91, 5000),
- (else_try),
- (assign, reg91, ":gold"),
- (try_end),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}bankadd.php?guid={reg90}&amount={reg91}&password={s101}"),
- ]),
- ("player_leave_in_database", #SERVER: send player guid to database to say he/she has left the server.
- [(store_script_param, ":player_id", 1),
- (player_get_unique_id, reg90, ":player_id"),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}playerleave.php?guid={reg90}&password={s101}"),
- ]),
- ("player_join_in_database", #SERVER: send player guid to database to say he/she has joined.
- [(store_script_param, ":player_id", 1),
- (player_get_unique_id, reg90, ":player_id"),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}playerjoin.php?guid={reg90}&password={s101}"),
- ]),
- ("check_player_name_in_database", #SERVER: send a player name and guid to the database to check if it is allowed RAMARAUNT SCRIPT
- [(store_script_param, ":player_id", 1),
- (str_store_player_username, s90, ":player_id"),
- (player_get_unique_id, reg90, ":player_id"),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}namecheck.php?guid={reg90}&password={s101}&name={s90}"),
- ]),
- ("cf_save_player_in_database", #SERVER: save a player to the database on the webserver RAMARAUNT SCRIPT
- [(store_script_param, ":player_id", 1),
- #CHECK IF ELIGABLE
- (player_is_active, ":player_id"),
- (player_get_agent_id, ":agent_id", ":player_id"),
- (agent_is_alive, ":agent_id"),
- (agent_is_human, ":agent_id"), #in case some wierd mod uses this without humans... *COUGH*illuminati*COUGH* :D
- #GET DATA
- (player_get_unique_id, reg90, ":player_id"),
- (agent_get_item_slot, reg91, ":agent_id", 4),
- (agent_get_item_slot, reg92, ":agent_id", 5),
- (agent_get_item_slot, reg93, ":agent_id", 7),
- (agent_get_item_slot, reg94, ":agent_id", 6),
- (agent_get_horse, ":horse_agent_id", ":agent_id"),
- (agent_get_item_id, reg95, ":horse_agent_id"),
- (store_agent_hit_points, reg96, ":horse_agent_id", 1),
- (agent_get_item_slot, reg97, ":agent_id", 0),
- (agent_get_item_slot, reg98, ":agent_id", 1),
- (agent_get_item_slot, reg99, ":agent_id", 2),
- (agent_get_item_slot, reg100, ":agent_id", 3),
- (store_agent_hit_points, reg101, ":agent_id", 1),
- (agent_get_slot, reg102, ":agent_id", slot_agent_food_amount),
- (player_get_gold, reg103, ":player_id"),
- (agent_get_position, pos4, ":agent_id"),
- (position_get_x, reg104, pos4),
- (position_get_y, reg105, pos4),
- (position_get_z, reg106, pos4),
- (agent_get_troop_id, reg107, ":agent_id"),
- (player_get_slot, reg108, ":player_id", slot_player_faction_id),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (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}"),
- ]),
- ("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
- [(store_script_param, ":integer_count", 1),
- (store_script_param, ":string_count", 2),
- (try_begin),
- (ge, ":integer_count", 1),
- (try_begin),
- (eq, reg1, 1), #uhoh, the player doesnt exist in the database. lets make him/her.
- (assign, ":player_guid", reg2),
- (str_store_string, s90, "str_name_server"),
- (str_store_string, s91, "str_name_server_password"),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (player_get_agent_id, ":cur_agent", ":cur_player"),
- (agent_get_position, pos2, ":cur_agent"),
- (position_get_x, reg90, pos2),
- (position_get_y, reg91, pos2),
- (position_get_z, reg92, pos2),
- (player_get_gold, reg93, ":cur_player"),
- #now lets build the string and send it!
- (str_store_string, s100, "str_name_server"),
- (str_store_string, s101, "str_name_server_password"),
- (send_message_to_url, "@{s100}accountcreate.php?guid={reg2}&posx={reg90}&posy={reg91}&posz={reg92}&player_gold={reg93}&password={s101}"),
- (try_end),
- (else_try),
- (eq, reg1, 2),#We just recieved orders from the webserver to change a player's loadout. Lets do it!
- (assign, ":player_guid", reg2),
- (assign, ":head", reg3),
- (assign, ":body", reg4),
- (assign, ":hand", reg5),
- (assign, ":foot", reg6),
- (assign, ":horse", reg7),
- (assign, ":horse_health", reg8),
- (assign, ":slot1", reg9),
- (assign, ":slot2", reg10),
- (assign, ":slot3", reg11),
- (assign, ":slot4", reg12),
- (assign, ":health", reg13),
- (assign, ":hunger", reg14),
- (assign, ":player_gold", reg15),
- #(assign, ":bank_gold", reg16), #don't need this
- (assign, ":posx", reg17),
- (assign, ":posy", reg18),
- (assign, ":posz", reg19),
- #(assign, ":banned_yes", reg20), #nor this
- (assign, ":admin_level", reg21),
- (assign, ":troop", reg22),
- (assign, ":faction", reg23),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (player_get_agent_id, ":cur_agent", ":cur_player"),
- # _ _ _
- # _ __ ___ ___(_) |_(_) ___ _ __
- # | '_ \ / _ \/ __| | __| |/ _ \| '_ \
- # | |_) | (_) \__ \ | |_| | (_) | | | |
- # | .__/ \___/|___/_|\__|_|\___/|_| |_|
- # |_|
- #
- (try_begin),
- (init_position, pos99),
- (position_set_x, pos99, ":posx"),
- (position_set_y, pos99, ":posy"),
- (position_set_z, pos99, ":posz"),
- (agent_set_position, ":cur_agent", pos99),
- (try_end),
- # _____
- # /__ \_ __ ___ ___ _ __
- # / /\/ '__/ _ \ / _ \| '_ \
- # / / | | | (_) | (_) | |_) |
- # \/ |_| \___/ \___/| .__/
- # |_|
- (try_begin),
- (neq, ":troop", -1),
- (player_set_troop_id,":troop", ":cur_player"),
- (try_end),
- # __ _ _
- # / _| __ _ ___| |_(_) ___ _ __
- # | |_ / _` |/ __| __| |/ _ \| '_ \
- # | _| (_| | (__| |_| | (_) | | | |
- # |_| \__,_|\___|\__|_|\___/|_| |_|
- #
- (try_begin),
- (neq, ":faction", -1),
- (call_script, "script_change_faction", ":cur_player", ":faction", change_faction_type_no_respawn),
- (try_end),
- # _
- # /_\ _ __ _ __ ___ ___ _ __
- # //_\\| '__| '_ ` _ \ / _ \| '__|
- # / _ \ | | | | | | | (_) | |
- # \_/ \_/_| |_| |_| |_|\___/|_|
- #
- (try_begin),
- (neq, ":head", -1),
- (agent_equip_item, ":cur_agent", ":head"),
- (try_end),
- (try_begin),
- (neq, ":body", -1),
- (agent_equip_item, ":cur_agent", ":body"),
- (try_end),
- (try_begin),
- (neq, ":feet", -1),
- (agent_equip_item, ":cur_agent", ":feet"),
- (try_end),
- (try_begin),
- (neq, ":hands", -1),
- (agent_equip_item, ":hands", ":head"),
- (try_end),
- # __ __
- # / \ / \ ____ _____ ______ ____ ____ ______
- # \ \/\/ // __ \\__ \ \____ \ / _ \ / \ / ___/
- # \ /\ ___/ / __ \| |_> > <_> ) | \\___ \
- # \__/\ / \___ >____ / __/ \____/|___| /____ >
- # \/ \/ \/|__| \/ \/
- #
- (try_begin),
- (neq, ":slot1", -1),
- (agent_equip_item, ":cur_agent", ":slot1", 1),
- (try_end),
- (try_begin),
- (neq, ":slot2", -1),
- (agent_equip_item, ":cur_agent", ":slot2", 2),
- (try_end),
- (try_begin),
- (neq, ":slot3", -1),
- (agent_equip_item, ":cur_agent", ":slot3", 3),
- (try_end),
- (try_begin),
- (neq, ":slot4", -1),
- (agent_equip_item, ":cur_agent", ":slot4", 4),
- (try_end),
- # ___ ___
- # / | \ ___________ ______ ____
- # / ~ \/ _ \_ __ \/ ___// __ \
- # \ Y ( <_> ) | \/\___ \\ ___/
- # \___|_ / \____/|__| /____ >\___ >
- # \/ \/ \/
- (try_begin),
- (neq, ":horse", -1),
- (position_move_x, pos4, 50),
- (position_set_z_to_ground_level, pos4),
- (set_spawn_position, pos4),
- (spawn_horse, ":horse"),
- (neq, ":horse_health", 100),
- (agent_set_health, reg0, ":horse_health", 1),
- (try_end),
- # ___ ___ .__ __ .__
- # / | \ ____ _____ | |_/ |_| |__
- # / ~ \_/ __ \\__ \ | |\ __\ | \
- # \ Y /\ ___/ / __ \| |_| | | Y \
- # \___|_ / \___ >____ /____/__| |___| /
- # \/ \/ \/ \/
- (try_begin),
- (neq, ":health", -1),
- (agent_set_health, ":cur_agent", ":health", 1),
- (try_end),
- # ___________ .___
- # \_ _____/___ ____ __| _/
- # | __)/ _ \ / _ \ / __ |
- # | \( <_> | <_> ) /_/ |
- # \___ / \____/ \____/\____ |
- # \/ \/
- (try_begin),
- (neq, ":food", -1),
- (agent_set_slot, ":cur_agent", slot_agent_food_amount, ":food"),
- (multiplayer_send_3_int_to_player, ":cur_player", server_event_agent_set_slot, ":cur_agent", slot_agent_food_amount, ":food"),
- (try_end),
- # _____ .___ .__
- # / _ \ __| _/_____ |__| ____
- # / /_\ \ / __ |/ \| |/ \
- # / | \/ /_/ | Y Y \ | | \
- # \____|__ /\____ |__|_| /__|___| /
- # \/ \/ \/ \/
- (try_begin),
- (eq, ":admin_level", 0),
- (try_begin),
- (player_is_admin, ":cur_player"),
- (player_set_is_admin, ":cur_player", 0),
- (kick_player, ":cur_player"),
- (try_end),
- (try_end),
- (try_end),
- (else_try),
- (eq, reg1, 3),#Time to print the amount of gold in the player's bank in the client's local chat.
- (assign, ":player_guid", reg2),
- (assign, ":bank_gold", reg3),
- (str_store_string, s90, "@You have {reg3} gold left in your bank."),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
- (try_end),
- (else_try),
- (eq, reg1, 4), #bank deposit was successful.
- (assign, ":player_guid", reg2),
- (str_store_string, s90, "@You deposit {reg3} gold."),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
- (player_get_gold, ":gold", ":cur_player"),
- (val_sub, ":gold", reg3),
- (player_set_gold, ":cur_player", ":gold"),
- (try_end),
- (else_try),
- (eq, reg1, 5), #bank deposit was only partially successful, due to hitting the bank cap.
- (assign, ":player_guid", reg2),
- (assign, ":return_gold", reg3),
- (str_store_string, s90, "@You can only deposit {reg3} gold because you hit the bank cap of {reg4}"),
- (str_store_string, s91, "@You can no longer deposit gold, due to you hitting the bank cap of {reg4}"),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (try_begin),
- (gt, ":return_gold", 0),
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
- (else_try),
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s91),
- (try_end),
- (player_get_gold, ":gold", ":cur_player"),
- (val_sub, ":gold", reg3),
- (player_set_gold, ":cur_player", ":gold"),
- (try_end),
- (else_try),
- (eq, reg1, 6), #bank withrdaw was successful
- (assign, ":player_guid", reg2),
- (str_store_string, s90, "@You withdraw {reg4} gold."),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
- (player_get_gold, ":gold", ":cur_player"),
- (val_add, ":gold", reg3),
- (player_set_gold, ":cur_player", ":gold"),
- (try_end),
- (else_try),
- (eq, reg1, 7), #bank witdraw was only partially successful, due to the bank becoming empty.
- (assign, ":player_guid", reg2),
- (assign, ":return_gold", reg3),
- (str_store_string, s90, "@You can only withdraw {reg3} gold because your bank is empty."),
- (str_store_string, s91, "@Your bank is empty, so you cannot withdraw any gold."),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (try_begin),
- (gt, ":return_gold", 0),
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s90),
- (else_try),
- (multiplayer_send_string_to_player, ":cur_player", server_event_local_chat, s91),
- (try_end),
- (player_get_gold, ":gold", ":cur_player"),
- (val_add, ":gold", reg3),
- (player_set_gold, ":cur_player", ":gold"),
- (try_end),
- (else_try),
- (eq, reg1, 8), #kick player (due to invalid name)
- (assign, ":player_guid", reg2),
- (try_for_players, ":cur_player"),
- (player_get_unique_id, ":cur_guid", ":cur_player"),
- (eq, ":cur_guid", ":player_guid"), #if this passes, we found the player!
- (neg|player_is_admin, ":cur_player"
- (kick_player, ":cur_player"),
- (try_end),
- (try_end),
- (try_end),
- ]),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement