These scripts set up a custom list of characters that are connected to the game world, so that we may easily iterate over user instances and operate on them, or gather metrics.
Code:
{
Author: Cups, 29th April 2019
Represents a custom chunk of memory for storing things that
may be used by enternal services and/or this game server.
}
[ENABLE]
alloc(cups, 1024)
// The player count and player list
alloc(CupsPlayerCount, 4)
alloc(CupsPlayerList, 4096)
// The npc count and npc list
alloc(CupsNpcCount, 4)
alloc(CupsNpcList, 16384)
// The mob count and mob list
alloc(CupsMobCount, 4)
alloc(CupsMobList, 32768)
// Store references to the various memory chunks
cups:
dd CupsPlayerCount
dd CupsPlayerList
dd CupsNpcCount
dd CupsNpcList
dd CupsMobCount
dd CupsMobList
// Store a reference to the chunk of memory
Cups::Pointer:
dd cups
registersymbol(CupsPlayerCount)
registersymbol(CupsPlayerList)
registersymbol(CupsNpcCount)
registersymbol(CupsNpcList)
registersymbol(CupsMobCount)
registersymbol(CupsMobList)
[DISABLE]
dealloc(cups)
dealloc(CupsPlayerCount)
dealloc(CupsPlayerList)
dealloc(CupsNpcCount)
dealloc(CupsNpcList)
dealloc(CupsMobCount)
dealloc(CupsMobList)
unregistersymbol(CupsPlayerCount)
unregistersymbol(CupsPlayerList)
unregistersymbol(CupsNpcCount)
unregistersymbol(CupsNpcList)
unregistersymbol(CupsMobCount)
unregistersymbol(CupsMobList)
Cups::Pointer:
dd 0
Code:
{
Author: Cups, 26th April 2019
Contains a list of players that are currently online in the game world
}
[ENABLE]
alloc(register_player, 128)
label(register_player_loop)
label(register_player_loop_exit)
label(register_player_exit)
alloc(deregister_player, 128)
label(deregister_player_replace)
label(deregister_player_exit)
registersymbol(register_player)
registersymbol(deregister_player)
{
A function designed to add a player's pointer
to the list of online players, and increment the player
count.
Usage:
push player
call Shaiya::Players::Register
}
register_player:
// Preserve the stack
push ebp
mov ebp, esp
pushad
pushfd
// Move the player pointer
mov edx,[ebp+08]
// If the player pointer is invalid, do nothing (this shouldn't even happen)
test edx,edx
je register_player_exit
// Increment the player count, and set the indexer to 0
inc [CupsPlayerCount]
xor ebx,ebx
xor edi,edi
xor eax,eax
// Loop through the current list, find a free space
register_player_loop:
mov ebx,eax
imul ebx,4
add ebx,CupsPlayerList
cmp [ebx],0
je register_player_loop_exit
inc eax
jmp register_player_loop
// Free space was found
register_player_loop_exit:
mov [edx+CUser.ListIndex],eax
mov dword ptr [ebx],edx
// Restore the stack
register_player_exit:
popfd
popad
pop ebp
retn 4
{
A function designed to remove a player's pointer
from the list of online players, and decrement the player
count.
Usage:
push player
call deregister_player
}
deregister_player:
// Preserve the stack
push ebp
mov ebp, esp
pushad
pushfd
// Move the player pointer
mov edx,[ebp+08]
// Decrement the player count
dec [CupsPlayerCount]
// EBX is the current index of the player
mov ebx,[edx+CUser.ListIndex]
mov [edx+CUser.ListIndex],0 // Clear the index memory of the current player
// Grab the address of the last player in the list
mov eax,[CupsPlayerCount]
imul eax,#4
add eax,CupsPlayerList
mov edx,[eax]
// If the player doesn't exist, exit the function
test edx,edx
jne deregister_player_replace
// Remove the current player
imul ebx,#4
add ebx,CupsPlayerList
mov [ebx],0
jmp deregister_player_exit
// Move the player into the current slot
deregister_player_replace:
mov [edx+CUser.ListIndex],ebx
imul ebx,#4
add ebx,CupsPlayerList
mov [ebx],edx
mov [eax],0
// Exit the function
deregister_player_exit:
// Restore the stack
popfd
popad
pop ebp
retn 4
[DISABLE]
dealloc(register_player)
dealloc(deregister_player)
unregistersymbol(register_player)
unregistersymbol(deregister_player)
unregistersymbol(player_count)
unregistersymbol(player_list)
Code:
{
Author: Cups, 26th April 2019
Registers a player to our player list when they enter
the game world
}
[ENABLE]
alloc(hook, 128)
hook:
push edi
call register_player
cmp byte ptr [edi+CUser.AdminStatus],0A
jmp ps_game.exe+55B1F
ps_game.exe+55B18:
jmp hook
db 90 90
[DISABLE]
dealloc(hook)
ps_game.exe+55B18:
cmp byte ptr [edi+CUser.AdminStatus],0A
Code:
{
Author: Cups, 26th April 2019
Deregisters a player from our player list when they
exit the game world
}
[ENABLE]
alloc(hook, 128)
hook:
push ebx
call deregister_player
cmp byte ptr [edi+CUser.AdminStatus],0A
jmp ps_game.exe+55CC3
ps_game.exe+55CBC:
jmp hook
db 90 90
[DISABLE]
dealloc(hook)
ps_game.exe+55CBC:
cmp byte ptr [edi+CUser.AdminStatus],0A
Code:
{
Author: Cups, 13th May 2019
Contains a list of npcs that currently exist in the game world
}
[ENABLE]
alloc(register_npc, 128)
label(register_npc_loop)
label(register_npc_loop_exit)
label(register_npc_exit)
alloc(deregister_npc, 128)
label(deregister_npc_replace)
label(deregister_npc_exit)
registersymbol(register_npc)
registersymbol(deregister_npc)
{
A function designed to add a npc's pointer
to the list of npcs, and increment the npc
count.
Usage:
push npc
call register_npc
}
register_npc:
// Preserve the stack
push ebp
mov ebp, esp
pushad
pushfd
// Move the npc pointer
mov edx,[ebp+08]
// If the npc pointer is invalid, do nothing (this shouldn't even happen)
test edx,edx
je register_npc_exit
// Increment the npc count, and set the indexer to 0
inc [CupsNpcCount]
xor ebx,ebx
xor edi,edi
xor eax,eax
// Loop through the current list, find a free space
register_npc_loop:
mov ebx,eax
imul ebx,4
add ebx,CupsNpcList
cmp [ebx],0
je register_npc_loop_exit
inc eax
jmp register_npc_loop
// Free space was found
register_npc_loop_exit:
mov [edx+CNpc.ListIndex],eax
mov dword ptr [ebx],edx
// Restore the stack
register_npc_exit:
popfd
popad
pop ebp
retn 4
{
A function designed to remove a npc's pointer
from the list of npcs, and decrement the npc
count.
Usage:
push npc
call deregister_npc
}
deregister_npc:
// Preserve the stack
push ebp
mov ebp, esp
pushad
pushfd
// Move the npc pointer
mov edx,[ebp+08]
// Decrement the npc count
dec [CupsNpcCount]
// EBX is the current index of the npc
mov ebx,[edx+CNpc.ListIndex]
mov [edx+CNpc.ListIndex],0 // Clear the index memory of the current npc
// Grab the address of the last npc in the list
mov eax,[CupsNpcCount]
imul eax,#4
add eax,CupsNpcList
mov edx,[eax]
// If the npc doesn't exist, exit the function
test edx,edx
jne deregister_npc_replace
// Remove the current npc
imul ebx,#4
add ebx,CupsNpcList
mov [ebx],0
jmp deregister_npc_exit
// Move the npc into the current slot
deregister_npc_replace:
mov [edx+CNpc.ListIndex],ebx
imul ebx,#4
add ebx,CupsNpcList
mov [ebx],edx
mov [eax],0
// Exit the function
deregister_npc_exit:
// Restore the stack
popfd
popad
pop ebp
retn 4
[DISABLE]
dealloc(register_npc)
dealloc(deregister_npc)
unregistersymbol(register_npc)
unregistersymbol(deregister_npc)
Code:
{
Author: Cups, 26th April 2019
Registers a player to our player list when they enter
the game world
}
[ENABLE]
alloc(hook, 128)
label(return)
hook:
push esi
call register_npc
sub esp,1C
push ebx
push ebp
jmp return
ps_game.exe+1D3A0:
jmp hook
return:
[DISABLE]
dealloc(hook)
ps_game.exe+1D3A0:
sub esp,1C
push ebx
push ebp
Code:
{
Author: Cups, 26th April 2019
Deregisters a npc from our npc list when they
exit the game world
}
[ENABLE]
alloc(hook, 128)
label(return)
hook:
push esi
call deregister_npc
sub esp,08
push ebx
push edi
jmp return
ps_game.exe+1E3B0:
jmp hook
return:
[DISABLE]
dealloc(hook)
ps_game.exe+1E3B0:
sub esp,08
push ebx
push edi
alloc(player_delete_item, 128)
registersymbol(player_delete_item)
{
Deletes an item from the player
Usage:
push player
push item
call DeleteItem
}
player_delete_item:
push ebp
mov ebp, esp
// Preserve the state of our registers
pushad
pushfd
mov edi,[ebp+08] // Item
mov ebx,[ebp+0C] // Player
// ECX = Type, EDX = TypeID
movzx ecx,[edi+40]
movzx edx,[edi+41]
// Delete the item
push edx
push ecx
push ebx
call CUser::ItemDelete
// Restore the stack
popfd
popad
pop ebp
retn #8
Code:
{
Author: Cups
A function wrapper used to give a player an item
Usage:
push player
push type
push type_id
call create_item_player
}
[ENABLE]
alloc(create_item_player, 128)
label(exit)
registersymbol(create_item_player)
// Creates an item for a player (player, type, typeid)
create_item_player:
push ebp // Save EBP
mov ebp, esp // Move the current stack to EBP
mov ecx,[ebp+8] // TypeID
mov eax,[ebp+0C] // Type
mov edi,[ebp+10] // Player
call CGameData::GetItemInfo // Result is now in EAX
// If the item info pointer is 0, don't create the item
cmp eax,0
je exit
// Player needs to be in ECX
mov ecx,edi
push #1 // Item count
push eax // Item data
call CUser::ItemCreate
exit:
pop ebp // Restore EBP to it's previous value
retn 0C // Restore the stack
Code:
// Author: Cups
// A function wrapper used to send a packet to a user
//
// Usage:
// push player
// push packet
// push length
// call send_packet_player
[ENABLE]
alloc(send_packet_player, 128)
registersymbol(send_packet_player)
// Send a packet to a user
send_packet_player:
push ebp // Save EBP
mov ebp, esp // Move the current stack to EBP
mov edx,[ebp+8] // Length
mov eax,[ebp+0C] // Packet
mov edi,[ebp+10] // Player
// Preserve the state of ECX
push ecx
// The player for the SConnection::Send
mov ecx,edi
// Push the packet length
push edx
// Push the packet data
push eax
// Call the function
call SConnection::Send
// Restore the state of ECX
pop ecx
pop ebp // Restore EBP to it's previous value
retn 0C // Restore the stack
{
Author: Cups, 29th April 2019
Checks the state of timed maps and teleports players out
if the map has closed.
}
[ENABLE]
alloc(timed_maps, 1024)
label(procedure)
label(map_loop)
label(loop_continue)
label(map_count)
label(map_list)
label(teleport_positions)
label(teleport_positions_light)
label(teleport_positions_fury)
label(teleport_positions_loop)
label(teleport_positions_bind)
label(teleport_positions_return)
label(time)
createthread(procedure)
timed_maps:
// The number of maps to check
map_count:
dd #1
{
The list of map data to process. Format should be:
dd #map_id_to_check
dd #fury_destination_map (float)destX (float)destY (float)destZ
dd #light_destination_map (float)destX (float)destY (float)destZ
}
map_list:
// Oblivion Insula
dd #64
dd #0 (float)100.00 (float)95.30 (float)42.30
dd #1 (float)20.00 (float)63.00 (float)10.00
// The procedure to check maps
procedure:
// Sleep for 1 second
push #1000
call KERNEL32.Sleep
// The current indexer
mov edx,[map_count]
mov ebp,map_list
// Loop through the maps
map_loop:
test edx,edx
je procedure
dec edx // EDX is the current map index
mov esi,edx
imul esi,#36
mov eax,[map_list+esi]
push edx
// Get the map pointer
imul eax,#520
mov ecx,[CWorld::Instance]
add eax,[ecx+CWorld.MapList]
test eax,eax
je procedure
// Move the map into edi
mov edi,eax
// If map can be entered
push time
push edi
call ps_game.exe+2F770
test eax,eax
jne loop_continue // Continue if the map is still open
mov edi,[edi] // CZone instance for the map
call ps_game.exe+29A00 // Move all users to the respawn location
// Continue the thread
loop_continue:
pop edx
jmp map_loop
// The time that the map will close
time:
db 00 00 00 00
// Define the teleport positions
teleport_positions:
pushad
pushfd
// The current map index and list
mov eax,[map_count]
// Loop through the maps
teleport_positions_loop:
test eax,eax
je teleport_positions_return
dec eax // EDX is the current map index
mov ecx,eax
imul ecx,#36
add ecx,map_list // EBP is the current map
// If we are not supposed to be checking this map, continue on with the loop
mov edx,[ecx]
cmp [ebx+CMap.Id],edx
jne teleport_positions_loop
// If the player to check for is a Light
cmp byte ptr [esi+CUser.Faction],0
jne teleport_positions_fury
// Configure the position offset for the Light
teleport_positions_light:
add ecx,#20
jmp teleport_positions_bind
// Configure the position offset for the Fury
teleport_positions_fury:
add ecx,#4
// Bind the destination positions
teleport_positions_bind:
// Teleport Type and Delay
mov [esi+CUser.TeleportType],#1
mov [esi+CUser.TeleportDelay],#1000
// Destination Map
mov edx,[ecx]
mov [esi+CUser.TeleportMapId],edx
// DestinationX
mov edx,[ecx+4]
mov [esi+CUser.TeleportDestX],edx
// DestinationZ
mov edx,[ecx+8]
mov [esi+CUser.TeleportDestZ],edx
// DestinationY
mov edx,[ecx+0C]
mov [esi+CUser.TeleportDestY],edx
popfd
popad
jmp ps_game.exe+29ADA
// Return control to the original procedure
teleport_positions_return:
popfd
popad
cmp dword ptr [esi+0000587C],00
jmp ps_game.exe+29A81
// Insert the teleport position call
ps_game.exe+29A76:
jmp teleport_positions
nop
Code:
{
Author: Cups, 27th April 2019
Changes the time required to wait after
pressing the "Resurrect on Leader" button
}
[ENABLE]
ps_game.exe+78EA2:
add eax,#5000
[DISABLE]
ps_game.exe+78EA2:
add eax,#30000
Code:
{
Author: Cups, 13th March 2018
Customises the "item creation" system at the Professional Blacksmith
}
[ENABLE]
alloc(item_creation, 4096) // Allocate enough bytes for all of our operations
label(CreationNoticePacket)
label(ItemCombination_Count)
label(ItemCombinations)
label(ItemRemake)
label(ItemRemake_Success)
label(ItemRemake_Success_Packet)
label(ItemRemake_Failed)
label(ItemRemake_Failed_Packet)
label(ItemRemake_Exit)
label(ItemComboCheck)
label(ItemComboCheck_Loop)
label(ItemComboCheck_Loop_Continue)
label(ItemComboCheck_Loop_Exit)
// Newly allocated memory
item_creation:
CreationNoticePacket:
db 0B F9
db #38
db 'You have successfully crafted an item!'
db 00
// The number of item combinations
ItemCombination_Count:
dd #4
// The item combinations (Third, Second, First, Result)
ItemCombinations:
dd #10065 #10065 #10065 #30001 // Queen Mab x 3
dd #100133 #100132 #100131 #91001
dd #100171 #100171 #100171 #100192
dd #30065 #28046 #30064 #30066
// The packet sent upon a successful item remake
ItemRemake_Success_Packet:
db 07 08 00
// The packet sent upon a failed item remake
ItemRemake_Failed_Packet:
db 07 08 02
{
Checks if an item is contained in a combination, and if so, returns
the item to create.
Usage:
push first_item
push second_item
push third_item
call ItemComboCheck
}
ItemComboCheck:
push ebp
mov ebp, esp
// Preserve the state of our registers
pushad
pushfd
// The items to check (Third, Second, First)
mov edx,[ebp+08]
mov ebx,[ebp+0C]
mov edi,[ebp+10]
// Define the items as their ids
mov edx,[edx+30]
mov edx,[edx]
mov ebx,[ebx+30]
mov ebx,[ebx]
mov edi,[edi+30]
mov edi,[edi]
// ESI = Item Array, EBX = Item Count
mov eax,[ItemCombination_Count]
mov esi,ItemCombinations
// Start of our loop
ItemComboCheck_Loop:
cmp eax,0
je ItemComboCheck_Loop_Exit
// If the first items are equal
cmp edx,[esi]
jne ItemComboCheck_Loop_Continue
// If the second items are equal
cmp ebx,[esi+04]
jne ItemComboCheck_Loop_Continue
// If the third items are equal
cmp edi,[esi+08]
jne ItemComboCheck_Loop_Continue
// Store the result on the stack
mov eax,dword ptr [esi+0C]
mov [ebp+08],eax
// Restore the registers
popfd
popad
// Set the result as the fourth item
mov eax,[ebp+08]
// Restore the stack
pop ebp
retn #12
// Continue iterating to the next item
ItemComboCheck_Loop_Continue:
dec eax
add esi,#16
jmp ItemComboCheck_Loop
// Exit the loop
ItemComboCheck_Loop_Exit:
// Restore the stack
popfd
popad
mov eax,0
pop ebp
retn #12
{
CUser::ItemRemake(CUser*, void* packet)
Packet structure:
07 08 = opcode
byte[3] = bags
byte[3] = slots
}
ItemRemake:
// Preserve the state of the stack
push ebp
mov ebp,esp
// Define the values from our stack parameters
// EBX = Current Player
mov esi,[ebp+08] // Packet
// Skip the opcode of the packet - it's not required
add esi,#2
// Preserve the state of our registers
push edx
push ecx
push edi
push ebx
// Check that the bags are under 5
cmp byte ptr [esi],#5
jg ItemRemake_Exit
cmp byte ptr [esi+1],#5
jg ItemRemake_Exit
cmp byte ptr [esi+2],#5
jg ItemRemake_Exit
// Check that the slots are under 23
cmp byte ptr [esi+3],#23
jg ItemRemake_Exit
cmp byte ptr [esi+4],#23
jg ItemRemake_Exit
cmp byte ptr [esi+5],#23
jg ItemRemake_Exit
// The location of an item is defined as:
// Player+0x1C0 + (Bag * 0x60) + (Slot * 0x4)
// Allocate bytes on the stack for our items
sub esp,#12
// Get the first item
movzx eax,[esi] // The bag
movzx ecx,[esi+3] // The slot
push ebx
push eax
push ecx
call GetItemAtPosition
mov [esp],eax
// Get the second item
movzx eax,[esi+1] // The bag
movzx ecx,[esi+4] // The slot
push ebx
push eax
push ecx
call GetItemAtPosition
mov [esp+4],eax
// Get the third item
movzx eax,[esi+2] // The bag
movzx ecx,[esi+5] // The slot
push ebx
push eax
push ecx
call GetItemAtPosition
mov [esp+8],eax
// If the items don't exist, do nothing
cmp dword ptr [esp],#0
je ItemRemake_Exit
cmp dword ptr [esp+4],#0
je ItemRemake_Exit
cmp dword ptr [esp+8],#0
je ItemRemake_Exit
// ECX is the current item to check
mov ecx,[esp+4]
// If any of the items are the same, do nothing
cmp [esp],ecx
je ItemRemake_Exit
mov ecx,[esp+8]
cmp [esp],ecx
je ItemRemake_Exit
cmp ecx,[esp+4]
je ItemRemake_Exit
// Check if the item is in a combination
push [esp]
push [esp+4]
push [esp+8]
call ItemComboCheck
// Restore the player pointer
pop ebx
// If the item is in a combination
cmp eax,0
jne ItemRemake_Success
// Failed to remake the item
jmp ItemRemake_Failed
// Send the successful remake packet
ItemRemake_Success:
// Delete the items
{
push ebx
push edi
call player_delete_item
push ebx
push esi
call player_delete_item
push ebx
push ecx
call player_delete_item
}
// EAX is the item to create, we need to calculate the type and typeid
mov edx,0 // Clear the dividend
mov ecx,#1000 // Divisor
div ecx // EAX = Quotient, EDX = Remainder
// Push the player, type and type id, and create the item
push ebx
push eax
push edx
call create_item_player
// Push the player, packet and length
push ebx
push ItemRemake_Success_Packet
push #3
call send_packet_player
// Send the notice packet
push ebx
push CreationNoticePacket
push #41
call send_packet_player
jmp ItemRemake_Exit
// Send the failed remake packet
ItemRemake_Failed:
// Push the player, packet and length
push ebx
push ItemRemake_Failed_Packet
push #3
call send_packet_player
// Restore the stack
ItemRemake_Exit:
add esp,#12
pop edx
pop ecx
pop edi
mov esp,ebp
pop ebp
ret #4
// Jump to our new procedure
ps_game.exe+6D950:
jmp ItemRemake
nop
[DISABLE]
dealloc(item_creation)
// Restore the original CUser::ItemRemake procedure
ps_game.exe+6D950:
sub esp,#752
Code:
{
Author: Cups, 6th March 2018
Removes the fee on removing an item from the Warehouse
}
[ENABLE]
// Player Warehouse
ps_game.exe+68ECB:
mov eax,0
db 90 90 90 90 90 90
// Guild Warehouse
ps_game.exe+35C86:
mov eax,0
db 90 90 90 90 90 90
[DISABLE]
// Player Warehouse
ps_game.exe+68ECB:
movzx eax,byte ptr [esi+42]
imul eax,[ecx+00000084]
// Guild Warehouse
ps_game.exe+35C86:
movzx ecx,byte ptr [ecx+42]
imul ecx,[eax+00000084]
Code:
{
Author: Cups, 7th March 2018
Disallows usage of specific items, unless they are in a guild that is currently
rank 1 from GRB.
}
[ENABLE]
alloc(item_check, 1024)
alloc(restricted_items_array, 1024)
label(item_count)
label(restricted_items)
label(restricted_loop)
label(loop_exit)
label(is_guild_rank1)
label(original_code)
label(disallow_item_use)
label(return)
// The memory used for our restricted item array
restricted_items_array:
// The number of items that are restricted
item_count:
dd #0
// The list of restricted item ids
restricted_items:
dd #0
// Checks the item in use (EBX = Item Pointer, EBP = Player)
item_check:
// Preserve the state of EAX and EDX
push eax
push edx
// Move the type to eax
movzx eax,[ebx+40]
mov edx,#1000
// Multiple the type by 1000
mul edx // EAX is now (type * 1000)
// Add the type id, eax is now a 4-byte item id
movzx edx,[ebx+41]
add eax,edx
// EDX is now the number of items in the restricted item array
mov edx,[item_count]
// Preserve the state of EDI - it will be our iterator
push edi
// Set EDI to the start of our array
mov edi,restricted_items
// Beginning of our loop
restricted_loop:
// If no items are left, exit the loop
cmp edx,0
je loop_exit
cmp eax,[edi]
je is_guild_rank1
add edi,4
sub edx,1
jmp restricted_loop
// Exit the loop
loop_exit:
// Restore the state of our iterator
pop edi
// The original code that we overwrote
original_code:
mov [esp+2C],ebx
test ebx,ebx
pop eax
pop edx
jmp return
// Check if the user is in a rank 1 guild
is_guild_rank1:
// If the player is not in a guild, disallow the item use
cmp dword ptr [ebp+1800],0
je disallow_item_use
// edi is now the CGuild ptr
mov edi,[ebp+1810]
// If the guild is not rank 1, disallow the item use
cmp byte ptr [edi+48],1
pop edi
jne disallow_item_use
jmp original_code
// Disallow the item usage
disallow_item_use:
pop edx
pop eax
jmp ps_game.exe+74698 // Jump to a call for CUser::ItemUseError
// Jump to our item check call
ps_game.exe+72E0A:
jmp item_check
nop
return:
[DISABLE]
dealloc(item_check)
dealloc(restricted_items_array)
ps_game.exe+72E0A:
mov [esp+2C],ebx
test ebx,ebx
Code:
{
Author: Cups, 6th March 2018
Allows users with an admin status to join a manual raid
}
[ENABLE]
alloc(raid_autojoin_override, 128)
alloc(raid_autojoin_override2, 128)
define(allow_join, ps_game.exe+50507)
define(allow_join2, ps_game.exe+7580D)
label(return)
label(return2)
// Override the check for joining a manual raid
raid_autojoin_override2:
// If the user has an admin status
cmp [ebp+CUser.AdminStatus],#11
jl allow_join2
// If the user is not an admin, check if the raid is manual before allowing entry
cmp byte ptr [eax+00000115],00
jmp return2
// Override the check for joining a manual raid
raid_autojoin_override:
// If the user has an admin status
cmp [ebx+5808],#11
jl allow_join
// If the user is not an admin, check if the raid is manual before allowing entry
cmp byte ptr [eax+00000115],00
jmp return
// Checks if the raid is manual
ps_game.exe+757DE:
jmp raid_autojoin_override2
db 90 90
return2:
// Checks if the raid is manual
ps_game.exe+504FE:
jmp raid_autojoin_override
db 90 90
return:
[DISABLE]
dealloc(raid_autojoin_override)
ps_game.exe+504FE:
cmp byte ptr [eax+00000115],00
ps_game.exe+757DE:
cmp byte ptr [eax+00000115],00
Code:
{
Author: Cups, 6th March 2018
Allows users with an admin status to join a raid regardless of it's faction
}
[ENABLE]
alloc(raid_faction_override, 128)
define(allow_join, ps_game.exe+757D8)
label(return)
// Override the check for faction when joining a raid
raid_faction_override:
// If the user has an admin status
cmp [ebp+5808],#11
jl allow_join
// If the user is not an admin, check if the raid is of the same faction
cmp dl,[edi+0000012D]
jmp return
// Checks if the user is in the same faction
ps_game.exe+757C0:
jmp raid_faction_override
db 90
return:
[DISABLE]
dealloc(raid_autojoin_override)
ps_game.exe+757C0:
cmp dl,[edi+0000012D]
Code:
{
Author: Cups, 8th May 2019
Stops deaths from being incremented in PvP.
}
[ENABLE]
ps_game.exe+67EFE:
db 90 90 90 90 90 90
[DISABLE]
ps_game.exe+67EFE:
mov [esi+CUser.Deaths],eax
Code:
{
Author: Cups, 21st May 2019
Modifies the check for maximum enchant level based on the
level of the item.
}
[ENABLE]
// Allocate extra memory for our new check
alloc(enchant_check, 128)
label(check_15)
label(check_30)
label(return)
// The maximum enchant levels for Lv15, Lv30, and Lv31+
define(max_enchant_15, #5)
define(max_enchant_30, #7)
define(max_enchant_31, #10)
// The new enchant cap check
enchant_check:
push eax
xor eax,eax
// Grab the level of the item being enchanted
mov eax,[edi+30]
mov ax,word ptr [eax+2E]
// If the level is 15 or lower
cmp ax,#15
jle check_15
// If the level is 30 or lower
cmp ax,#30
jle check_30
// Check the 31+ enchant cap
pop eax
cmp byte ptr [esp+13],max_enchant_31
jmp return
// Check the 30 enchant cap
check_30:
pop eax
cmp byte ptr [esp+13],max_enchant_30
jmp return
// Check the 15 enchant cap
check_15:
pop eax
cmp byte ptr [esp+13],max_enchant_15
jmp return
// Insert the jump to our new enchant cap check
ps_game.exe+6CCBD:
jmp enchant_check
return:
[DISABLE]
dealloc(enchant_check)
ps_game.exe+6CCBD:
cmp byte ptr [esp+13],#20
Code:
{
Author: Cups, 8th May 2019
Adds support for an item effect to spawn a mob at the player's location
}
[ENABLE]
alloc(SpawnMobItemEffect, 128)
registersymbol(SpawnMobItemEffect)
{
Gets executed when a player uses an item that should spawn a mob.
ESI = Player
EAX = Variant
}
SpawnMobItemEffect:
// Push the current zone
mov ecx,[esi+CUser.Zone]
push ecx
// Grab the current position
mov ecx,eax
lea ebx,[esi+CUser.PosX]
mov eax,1 // The number of mobs to spawn
call CZone::MobGen
retn
[DISABLE]
dealloc(SpawnMobItemEffect)
unregistersymbol(SpawnMobItemEffect)
Code:
{
Author: Cups, 8th May 2019
Adds support for an item effect to spawn an NPC at the player's location
}
[ENABLE]
alloc(SpawnNpcItemEffect, 128)
alloc(HeightOffset, 4)
registersymbol(SpawnNpcItemEffect)
// The height offset for spawning a NPC properly
HeightOffset:
dd (float)0.9
{
Gets executed when a player uses an item that should spawn an NPC.
ESI = Player
EAX = Variant
}
SpawnNpcItemEffect:
// Allocate 12 bytes on the stack for the position
sub esp,0C
// Move the X and Z values
mov edx,[esi+CUser.PosX]
mov [esp],edx
mov edx,[esi+CUser.PosZ]
mov [esp+8],edx
// Load the user's height and decrement 0.9
fld dword ptr [esi+CUser.PosY]
fsub dword ptr [HeightOffset]
fstp dword ptr [esp+4]
// Grab the current position
mov edi,esp
// Divide the variant by 1000
xor edx,edx
mov ecx,#1000
div ecx
push edx
push eax
// Move the zone into ECX
mov ecx,[esi+CUser.Zone]
call CZone::NpcCreate
add esp,0C
retn
[DISABLE]
dealloc(SpawnNpcItemEffect)
dealloc(HeightOffset)
unregistersymbol(SpawnNpcItemEffect)
Code:
Author: Cups, 8th May 2019
Adds support for handling custom item effects
}
[ENABLE]
alloc(EffectList, 1024)
alloc(ItemEffectHook, 128)
label(Success)
label(Exit)
label(Return)
{
The list of functions to execuute at specific effect types. This
list starts at effect 80.
}
EffectList:
dd SpawnMobItemEffect // 80
dd SpawnNpcItemEffect // 81
{
Checks for the effect value of an item, and if it matches any
in the effect list, executes the item.
EAX = Item Definition
ECX = Item effect
ESI = Player
}
ItemEffectHook:
movzx ecx,byte ptr [eax+46] // ECX is the item effect
push ebx
push edx
// EBX is the item effect type
cmp ecx,#80
jl Exit // If lower than 80, exit the procedure
mov ebx,ecx
sub ebx,#80
// EDX is the function pointer
mov edx,[ebx*4+EffectList]
// If no function exists for the effect, exit the hook
test edx,edx
je Exit
// Call the item effect function
pushad
pushfd
mov eax,[eax+stItemInfo.Variant]
call edx
popfd
popad
jmp Success
// Successful execution
Success:
pop edx
pop ebx
jmp ps_game.exe+73197
// Exit the item effect hook
Exit:
pop edx
pop ebx
jmp Return
// Insert the hook
ps_game.exe+73163:
jmp ItemEffectHook
db 90 90
Return:
[DISABLE]
dealloc(EffectList)
dealloc(ItemEffectHook)
ps_game.exe+73163:
movzx ecx,byte ptr [eax+46]
cmp ecx,4C
Code:
{
Author: Cups, 12th May 2019
Allows admin characters to ignore the distance checks
when running, as Ep8 enables invisible GMs to move quicker
than normally allowed.
}
[ENABLE]
alloc(Hook, 128)
label(Return)
Hook:
call ps_game.exe+78240
cmp [edi+CUser.AdminStatus],0
je Return
xor eax,eax
jmp Return
ps_game.exe+78670:
jmp Hook
Return:
[DISABLE]
dealloc(Hook, 128)
ps_game.exe+78670:
call ps_game.exe+78240
Code:
// Disables the call to the database for /warning (fixes SQL injection via warning)
[ENABLE]
ps_game.exe+836C6:
jmp ps_game.exe+841B8
[DISABLE]
ps_game.exe+836C6:
mov ebx,[esp+18]
push edi
Save this as "Shaiya.CSX" and import it to cheat engine to enable usage of named fields in scripts / debugging (has several identified structures to make development easier)
[Selling] SWIFT Spectral Tiger and more ---> Read Description for more Info & References (DISC 03/02/2018 - World of Warcraft Trading - 0 Replies Contact me on Skype
⭐I am online almost 0/24 but get in touch on Skype first, because I'm advertising on several Platforms⭐
Skype: [email protected]
Hey Guys, I am Ricsi!
A few words about Me and Konzolvilag
⭐I am one of the owners of Konzolvilag⭐
⭐Konzolvilag is one of the most popular Gaming Shop in Hungary⭐
⭐Earned the Best Shop In Hungary award in 2016 in Gaming Category⭐
Chefville Tips,Cheat,Guide & Hacks: Complete Guide & References 10/02/2012 - Facebook - 0 Replies Hi, ePvpers explorer, How are you? Chefville, one of the latest games from Zynga, is a game where you get to build your dream restaurant. I get a complete guide including tips , cheat , guide , walkthrough and suggestion to share with you. Chefville Complete Tips.
I Think you found this helpful.
Mobs/bosses references 03/28/2012 - Shaiya Private Server - 6 Replies Hello,
I'd like that the mobs / bosses are the same as on the official server. Is there a reference or a patch?
I saw that we could set them individually but I do not know the basic values
Help me pls:(
HellMouth References 06/09/2011 - CO2 Private Server - 4 Replies Alright. I am using C# 2008, I fixed all the errors (thanks to Justin). I still got one problem: References.
So the thing is, when I delete a reference, then add it again, I still get the warning that it can't find the reference.
So here is a screenshot:
http://img833.imageshack.us/img833/8669/screenlb. png
Any help will be greatly appreciated.
Thank you