Skip to content

Instantly share code, notes, and snippets.

View cydh's full-sized avatar

Cydh Ramdh cydh

View GitHub Profile
<?php
if (!defined('FLUX_ROOT')) exit;
require_once 'Flux/FileLoad.php';
$itemDescTable = Flux::config('FluxTables.ItemDescTable');
$title = 'Item Info';
$fileLoad = new FileLoad();
// upload and parse map.
if($files->get('iteminfo')) {
$itemInfo = FLUX_ROOT . '/itemInfo.lua';
@cydh
cydh / Flux with Respect Validation.md
Last active December 1, 2022 19:14
Quick guide to add Respect/Validation to FluxCP

Adding Respect/Validation

The simpliest way to add Respect/Validation into FluxCP

  1. Create new direcotry in FLUX_ROOT/lib/ with name respectvalidation
  2. Followed its installation guide by using command line in respectvalidation directory
composer require respect/validation
  1. In any module file you want to add the input validation (example: modules/character/view.php) add the respect/validation autoload
require 'respectvalidation/vendor/autoload.php';
@cydh
cydh / herc-private_airship.txt
Created July 31, 2018 09:17
Sample custom run for Private Airship (Herc's script)
- script private_airship FAKE_NPC,{
end;
S_AirShipIsNeedItem:
for (.@i = 0; .@i < getarraysize(.needitem); .@i += 2) {
if (@airshipitem_id == .needitem[.@i]) {
@airshipitem_amount = .needitem[.@i+1]; //<--- Set the amount will be deleted
return true;
}
@cydh
cydh / guide_refine_db.md
Last active May 27, 2019 17:53
Guide to modify edited Refine DB related to https://github.com/cydh/rathena/pull/10
@cydh
cydh / add_custom_map.md
Last active September 28, 2018 09:32
Adding custom map as copy of gld2_prt, gld2_pay, gld2_gef, gld2_ald

Requirements:

  1. Tokei's GRF Editor, can be downloaded here
  2. WeeMapCache, can be downloaded here
  3. rAthena

Steps

  1. Open GRF Editor
  2. Open kRO's data.grf (or any grf file taht you think it contains the map that you want)
  3. Find files for gld2_ maps
@cydh
cydh / mob_db_atk_matk_diff.json
Last active October 15, 2018 00:30
related to https://github.com/rathena/rathena/pull/3574 renewal mob_db atk1 and atk2 differences
{
"ATK1Counts": 1216,
"ATK2Counts": 1724,
"Counts": 1724,
"Monsters": {
"1001": {
"ATK2": {
"Old": 40,
"New": 7
}

Sum elements of numeric array(s) for rAthena

//////////////////////////////////////////////////////////////////////////////////
// Sum elements of numeric array(s)
// Example:
//   setarray .@array1[0],2,3,1,5;
//   setarray .@array2[0],-3,-5,1;
//   .@total = callfunc("F_ArraySum",.@array1);          // will returns 11
//   .@total = callfunc("F_ArraySum",.@array1,.@array2); // will returns 4
//////////////////////////////////////////////////////////////////////////////////
src/map/skill.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index a45362a1a..69f733314 100755
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -2641,7 +2641,7 @@ bool skill_strip_equip(struct block_list *src, struct block_list *target, uint16
const enum sc_type sc_atk[5] = {SC_STRIPWEAPON, SC_STRIPSHIELD, SC_STRIPARMOR, SC_STRIPHELM, SC__STRIPACCESSORY};
const enum sc_type sc_def[5] = {SC_CP_WEAPON, SC_CP_SHIELD, SC_CP_ARMOR, SC_CP_HELM, SC_NONE};
@cydh
cydh / iteml.pl
Last active February 3, 2021 16:39
A function to solve message with <ITEML> contents from item link feature.
# Solve message that contains <ITEML> to kore-style item name
sub solveITEML {
my ($msg) = @_;
if ($msg =~ /<ITEML>([a-zA-Z0-9\%\&\(\,\+\*]*)<\/ITEML>/) {
my $newmsg = $msg;
$newmsg =~ s/<ITEML>([a-zA-Z0-9\%\&\(\,\+\*]*)<\/ITEML>/{itemlink}/g; # I don't really like this part
my (@items) = grep { $_; } $msg=~ /<ITEML>([a-zA-Z0-9\%\&\(\,\+\*]*)<\/ITEML>/g;
for my $item (@items) {
my $refine = 0;
@cydh
cydh / rorclientitem_diff.txt
Last active December 6, 2018 10:49
Hasil perbandingan file client idRO Renewal untuk file idnum2* dengan format id:missing|what.
555:desc
556:desc
557:desc
562:desc
563:desc
585:desc
586:desc
588:desc
589:desc
590:desc