Skip to content

Instantly share code, notes, and snippets.

View cydh's full-sized avatar

Cydh Ramdh cydh

View GitHub Profile
case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex]
clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
skill_blown(src,bl,skill_get_blewcount(skill_id,skill_lv),unit_getdir(bl),2);
break;
@cydh
cydh / [ok]item_list_window_selected.patch
Last active April 29, 2016 11:52
Source for select item list window by Change Material and Four Spirits Analysis skill. Added 2 commands `cm` for Change Material and `analysis` for Four Spirits Analysis that only can be used after skill is casted. Now, you can make simple macro! See https://gist.github.com/cydh/e8167633881f44c76759943a3a1e66ab
Index: src/Commands.pm
===================================================================
--- src/Commands.pm (revision 9032)
+++ src/Commands.pm (working copy)
@@ -236,6 +236,10 @@
southeast => \&cmdManualMove,
southwest => \&cmdManualMove,
captcha => \&cmdAnswerCaptcha
+
+ # [Cydh]
@cydh
cydh / [ok]rough_oridecon_to_oridecon.txt
Created May 29, 2016 06:47
Simple macro to convert Rough Oridecon to Oridecon by talking with NPC Dietrich inside the Prontera's refinery building | (c) Cydh/PServeRO
# Simple macro to convert Rough Oridecon to Oridecon
# by talking with NPC Dietrich inside the Prontera's refinery building
#
# HOW TO USE:
# 1. Manually move Rough Oridecon to inventory
# 2. Walk into Dietrich location
# 3. Call teh macro in console: macro doConvOri
#
# (c) Cydh/PServeRO
@cydh
cydh / [ok]cm_createalchol.txt
Last active June 10, 2016 23:19
Macro to Exchange Material (GN_CHANGEMATERIAL) | Creating Alchol/Alcohol by each 50 Orcish Voucer + 40 Skel-Bone | PLEASE MAKE SURE YOUR OPENKORE IS SUPPORTED BY cm COMMAND, OR TRY USE THIS MY BRANCH: https://github.com/cydh/openkore/tree/feature/skill_exchange_item | (c) Cydh/PServeRO.com
# Macro to Exchange Material (GN_CHANGEMATERIAL)
# Creating Alchol/Alcohol by each 50 Orcish Voucer + 40 Skel-Bone
#
# PLEASE MAKE SURE YOUR OPENKORE IS SUPPORTED BY cm COMMAND, OR
# TRY USE THIS MY BRANCH: https://github.com/cydh/openkore/tree/feature/skill_exchange_item
#
# (c) Cydh/PServeRO.com
macro doConvAlchol {
log doConvAlchol
@cydh
cydh / [ok]cm_tsurugi2steel.txt
Last active June 10, 2016 23:20
This snippet may depreciated, please read https://gist.github.com/cydh/7b77580fc50b8f8b508c38dca296325a | Sample macro for Change Material skill after patching the https://gist.github.com/cydh/e1473eb2a242d221e80a42dce4ed7093. Change the Tsurugi [1] to Steel for simple lines!
macro doConvSteel {
$per = @eval($.weight * 100 / $.maxweight)
# log \$per $per
$count = @invamount (Tsurugi [1])
while ($count > 0 && $per < 90) as loop
do ss GN_CHANGEMATERIAL
pause 2
$idx = @inventory (Tsurugi [1])
# log \$idx $idx
do cm $idx 1
@cydh
cydh / followup-0647b159.diff
Created August 15, 2016 13:57
* Cleaned up `clif_status_change`. * Removed `BL_SCEFFECT` and `StatusRelevantBLTypes` array.
diff --git a/src/map/clif.c b/src/map/clif.c
index 9387c3f..ccf134f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5820,10 +5820,17 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id
/// 0196 <index>.W <id>.L <state>.B (ZC_MSG_STATE_CHANGE) [used for ending status changes and starting them on non-pc units (when needed)]
/// 043f <index>.W <id>.L <state>.B <remain msec>.L { <val>.L }*3 (ZC_MSG_STATE_CHANGE2) [used exclusively for starting statuses on pcs]
/// 0983 <index>.W <id>.L <state>.B <total msec>.L <remain msec>.L { <val>.L }*3 (ZC_MSG_STATE_CHANGE3) (PACKETVER >= 20120618)
-void clif_status_change_sub(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3, enum send_target target_type)
+/// @param bl Show/send packet to clients around this object
@cydh
cydh / random_option_npc.txt
Created November 10, 2016 11:04
Sample NPC to add Random Option for Crimson Weapons
prontera,109,187,3 script Crimson Weapon Enchanter 4_F_KAFRA3,{
mes "[Kafra]";
.@i = getequipid(EQI_HAND_R);
if (.@i == -1) {
mes "You don't hold any weapon!";
close;
}
mes "What element you want to endow?";
next;
.@menu$ = "";
@cydh
cydh / Double_attack_on_Emperium.diff
Last active December 19, 2016 12:41
Double attack on Emperium is miss on rAthena. This diff fixes for issue #217 (https://github.com/rathena/rathena/issues/217). Reason for this change, see my comment below.
diff --git a/src/map/battle.c b/src/map/battle.c
index 825436e..70a3846 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3282,9 +3282,10 @@ static struct Damage battle_calc_multi_attack(struct Damage wd, struct block_lis
|| ( sd->bonus.double_rate > 0 && sd->weapontype1 != W_FIST ) //Will fail bare-handed
|| ( sc && sc->data[SC_KAGEMUSYA] && sd->weapontype1 != W_FIST )) // Need confirmation
{ //Success chance is not added, the higher one is used [Skotlex]
- int max_rate = max(5*skill_lv,sd->bonus.double_rate);
- if(sc && sc->data[SC_KAGEMUSYA]) max_rate= max(max_rate,sc->data[SC_KAGEMUSYA]->val1*3);
@cydh
cydh / disabling_job.diff
Last active January 6, 2017 01:31
To disable certain job in rAthena just comment the job line from db/[pre-]re/job_db1.txt. Example usage to disable 2 Trans, 3rd, Babies, and Expanded for Ragnarok server.
diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf
index f4dfc46..ab14daa 100644
--- a/conf/msg_conf/map_msg.conf
+++ b/conf/msg_conf/map_msg.conf
@@ -753,7 +753,8 @@
//Skill messages
720: %s is required.
721: [%s] Poison effect was applied to the weapon.
-//722: Free
+
- script AtCommandCheck -1,{
OnCommandCheck:
.@map$ = strcharinfo(3);
if (.@atcmd_command$ == "warp") {
if (.@map$ == "prontera" || .@map$ == "izlude")
end;
useatcmd .@atcmd_command$ .@atcmd_parameters$[0];
end;
}