summaryrefslogtreecommitdiff
path: root/doc/sample
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sample')
-rw-r--r--doc/sample/getiteminfo.txt30
-rw-r--r--doc/sample/npc_rodex.txt39
-rw-r--r--doc/sample/npc_test_setitemx.txt11
-rw-r--r--doc/sample/npc_trader_sample.txt8
4 files changed, 76 insertions, 12 deletions
diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt
index 89f9a66b5..9d5121635 100644
--- a/doc/sample/getiteminfo.txt
+++ b/doc/sample/getiteminfo.txt
@@ -9,15 +9,33 @@
//============================================================
prontera,156,179,6 script test_getiteminfo 4_F_KAFRA1,{
- mes "Please enter an item ID.";
- input .@value;
+ mes("Please enter an item ID.");
+ input(.@value);
// This line uses an INTERNAL function of your client to show item name by its ID!
// ^nItemID^XXXX -> Item Name
- mes "Item ID: "+.@value+" ^nItemID^"+.@value;
+ mesf("Item ID: %d ^nItemID^%d", .@value, .@value);
- mes "Current item info:";
- for (.@id = 0; .@id < 14; ++.@id)
- mes " getiteminfo("+.@value+","+.@id+") = "+getiteminfo(.@value,.@id);
+ mes("Current item info:");
+ mesf("Buy Price: %d", getiteminfo(.@value, ITEMINFO_BUYPRICE));
+ mesf("Sell Price: %d", getiteminfo(.@value, ITEMINFO_SELLPRICE));
+ mesf("Type: %d", getiteminfo(.@value, ITEMINFO_TYPE));
+ mesf("Max drop chance: %d.%02d", getiteminfo(.@value, ITEMINFO_MAXCHANCE) / 100, getiteminfo(.@value, ITEMINFO_MAXCHANCE) % 100);
+ mesf("Sex: %d", getiteminfo(.@value, ITEMINFO_SEX));
+ mesf("Equip location: %d", getiteminfo(.@value, ITEMINFO_LOC));
+ mesf("Weight: %d.%d", getiteminfo(.@value, ITEMINFO_WEIGHT) / 10, getiteminfo(.@value, ITEMINFO_WEIGHT) % 10);
+ mesf("Attack: %d", getiteminfo(.@value, ITEMINFO_ATK));
+ mesf("Defense: %d", getiteminfo(.@value, ITEMINFO_DEF));
+ mesf("Range: %d", getiteminfo(.@value, ITEMINFO_RANGE));
+ mesf("Slots: %d", getiteminfo(.@value, ITEMINFO_SLOTS));
+ mesf("Subtype: %d", getiteminfo(.@value, ITEMINFO_SUBTYPE));
+ mesf("Equip Level: %d", getiteminfo(.@value, ITEMINFO_ELV));
+ mesf("Weapon Level: %d", getiteminfo(.@value, ITEMINFO_WLV));
+ mesf("View ID: %d", getiteminfo(.@value, ITEMINFO_VIEWID));
+ mesf("MATK: %d", getiteminfo(.@value, ITEMINFO_MATK));
+ mesf("View Sprite: %d", getiteminfo(.@value, ITEMINFO_VIEWSPRITE));
+
+ .@trade$ = callfunc("F_GetTradeRestriction", .@value);
+ mesf("Trade Restriction: %s", .@trade$);
close;
}
diff --git a/doc/sample/npc_rodex.txt b/doc/sample/npc_rodex.txt
new file mode 100644
index 000000000..0975e609c
--- /dev/null
+++ b/doc/sample/npc_rodex.txt
@@ -0,0 +1,39 @@
+//===== Hercules Script =======================================
+//= Sample: RoDEX Send Mail
+//===== By: ==================================================
+//= KirieZ
+//===== Current Version: =====================================
+//= 20170322
+//===== Description: =========================================
+//= Demonstrates sending mails through RoDEX.
+//============================================================
+
+prontera,150,150,4 script Rodex Mail 1_M_01,{
+ // Sends a messsage to attached player from "Rodex Test", with title "Rodex Test1",
+ // with message "Hello World, How are You?", 1000 Zenies and 5 Red Potions attached
+ rodex_sendmail(
+ getcharid(CHAR_ID_CHAR), "Rodex Test", "Rodex Test1", "Hello World, How are You?",
+ 1000,
+ Red_Potion, 5
+ );
+
+ // Sends a messsage to attached player "Account Box" from "Rodex Test", with title "Rodex Test3",
+ // with message "Hello World, How are You?", 1000 Zenies and 5 Red Potions attached
+ rodex_sendmail_acc(
+ getcharid(CHAR_ID_ACCOUNT), "Rodex Test", "Rodex Test3", "Hello World, How are You?",
+ 1000,
+ Red_Potion, 5
+ );
+
+ // Sends a messsage to attached player from "Rodex Test", with title "Rodex Test6",
+ // with message "Hello World, How are You?", 1000 Zenies, 5 Red Potions and
+ // 1 +10 Knife[3] with 3 Poring Cards (Broken)
+ rodex_sendmail2(
+ getcharid(CHAR_ID_CHAR), "Rodex Test", "Rodex Test6", "Hello World, How are You?",
+ 1000,
+ Red_Potion, 5, 0, 0, 0, 0, 0, 0,
+ Knife, 1, 10, 1, Poring_Card, Poring_Card, Poring_Card, 0
+ );
+
+ end;
+}
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt
index a06f0dc9f..519cfa363 100644
--- a/doc/sample/npc_test_setitemx.txt
+++ b/doc/sample/npc_test_setitemx.txt
@@ -14,15 +14,14 @@ prontera,164,161,5 script Lupus WOLF,{
switch (select("Make Knife[3] Edible", "Make Apple Equippable", "Edible Knife = Full SP", "Knife = Weapon + 3 Notes")) {
case 1:
mes "Ok. We made Knife[3] edible.";
- setiteminfo(Knife, 2, IT_HEALING); //type = 0 : potion
+ setiteminfo(Knife, ITEIMINFO_TYPE, IT_HEALING);
setitemscript(Knife, "{dispbottom \"* You used Knife[3]\";}");
break;
case 2:
mes "Ok. We made Apple equippable.";
- setiteminfo(Apple, 2, IT_ARMOR); //item type -> headgear (type = 5 -> IT_ARMOR)
- setiteminfo(Apple, 5, 512); //where to equip to (equip = 512)
- setiteminfo(Apple, 11, 256); //set as headgear location (loc = 256)
- setiteminfo(Apple, 14, 85); //set Headgear Sprite ID (view id = 85)
+ setiteminfo(Apple, ITEMINFO_TYPE, IT_ARMOR);
+ setiteminfo(Apple, ITEMINFO_LOC, EQP_HEAD_MID); //where to equip to (equip = 512)
+ setiteminfo(Apple, ITEMINFO_VIEWID, 85); //set Headgear Sprite ID (view id = 85)
setitemscript(Apple, "{dispbottom \"* Other item's changed\";}", 0);
setitemscript(Apple, "{dispbottom \"* Equipped\";}", 1);
setitemscript(Apple, "{dispbottom \"* Unequipped\";}", 2);
@@ -34,7 +33,7 @@ prontera,164,161,5 script Lupus WOLF,{
break;
case 4:
mes "Ok. We made Knife a weapon, but added 3 notes.";
- setiteminfo(Knife, 2, IT_WEAPON); //type = 4 -> IT_WEAPON
+ setiteminfo(Knife, ITEIMINFO_TYPE, IT_WEAPON);
setitemscript(Knife, "{dispbottom \"* 1 Used\";}", 0);
setitemscript(Knife, "{dispbottom \"* 2 Equipped\";}", 1);
setitemscript(Knife, "{dispbottom \"* 3 Unequipped\";}", 2);
diff --git a/doc/sample/npc_trader_sample.txt b/doc/sample/npc_trader_sample.txt
index 0d50af8c5..24c53330b 100644
--- a/doc/sample/npc_trader_sample.txt
+++ b/doc/sample/npc_trader_sample.txt
@@ -56,3 +56,11 @@ OnMyResupply:
sellitem Red_Potion,-1,49;
end;
}
+/* demonstrate barter shop */
+prontera,159,284,4 trader Barter Shop#prt 4_M_KID1,{
+OnInit:
+ tradertype(NST_BARTER);
+ sellitem White_Herb, 100, Red_Potion, 2;
+ sellitem Blue_Herb, 200, Orange_Potion, 3;
+ end;
+}