diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-08-05 03:17:28 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-08-05 03:25:44 -0300 |
commit | 01c5867999b02f367d74698d73638a0104572c67 (patch) | |
tree | 1bfb49128a4236371b85b879583bf03cbdff12eb | |
parent | 1c23f4b7215261fdfad4318e8a5eade55082f7a6 (diff) | |
download | serverdata-01c5867999b02f367d74698d73638a0104572c67.tar.gz serverdata-01c5867999b02f367d74698d73638a0104572c67.tar.bz2 serverdata-01c5867999b02f367d74698d73638a0104572c67.tar.xz serverdata-01c5867999b02f367d74698d73638a0104572c67.zip |
Rebase and item
-rw-r--r-- | db/re/item_db.conf | 21 | ||||
-rw-r--r-- | npc/000-0-1/narrator.txt | 2 | ||||
-rw-r--r-- | npc/functions/main.txt | 8 | ||||
-rw-r--r-- | npc/items/gift.txt | 21 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
5 files changed, 44 insertions, 9 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index b5fc84e3..21c8ba3e 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -1279,6 +1279,27 @@ item_db: ( Sell: 65 Weight: 100 }, +{ + Id: 621 + AegisName: "FriendGift" + Name: "Friend Gift" + Buy: 0 + Sell: 0 + Weight: 0 + KeepAfterUse: false + Refine: false + Trade: { + notrade: true + nodrop: true + noselltonpc: true + nogstorage: true + nomail: true + noauction: true + } + Script: <" + callfunc("OpenFriendGift"); + "> +}, // Generic diff --git a/npc/000-0-1/narrator.txt b/npc/000-0-1/narrator.txt index 8b0bf5cc..3ccf2ec5 100644 --- a/npc/000-0-1/narrator.txt +++ b/npc/000-0-1/narrator.txt @@ -127,7 +127,7 @@ function referralSystem { input .@ref$; mes ""; if (.@ref$ != "") { - .@ref=gf_accid(strip(.@ref$)); + .@ref="playerCache"::name2account(strip(.@ref$)); if (.@ref > 0) { // Case 1: Yourself if (.@ref == getcharid(3)) { diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 471df271..1ae37a35 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -224,14 +224,6 @@ function script npctalkonce { return true; } -// Get some acc id from char name, even if offline. -// This is a highly sensitive function; Use with caution. -// gf_accid( Name ) -function script gf_accid { - .@nb = query_sql("SELECT account_id FROM `char` WHERE name='"+escape_sql(getarg(0))+"' LIMIT 2", .@value); - return .@value[0]; -} - function script getquestlink { return "[@@q" + getarg(0) + "|@@]"; } diff --git a/npc/items/gift.txt b/npc/items/gift.txt new file mode 100644 index 00000000..9f5296f3 --- /dev/null +++ b/npc/items/gift.txt @@ -0,0 +1,21 @@ +// Referral Gifts +// Rebased from Moubootaur Legends +// Author: +// Jesusalva + +function script OpenFriendGift { + if (BaseLevel < 5) { + dispbottom l("You must reach level 5 to open this gift."); + getitembound FriendGift, 1, 1; + } else { + //getitem EventCoin, rand(1,3); + .@aid=getvaultvar(REFERRAL_PROG); + .@vid="playerCache"::account2vault(.@aid); + .@cid="playerCache"::account2char(.@aid); + .@cn$="playerCache"::account2name(.@aid); + $REFERRAL_IDS[.@vid]=$REFERRAL_IDS[.@vid]+1; + dispbottom l("Oooh, a gift from %s!", .@cn$); + rodex_sendmail(.@cid, "TMW Team", "Invite Accepted", strcharinfo(0)+" accepted your invite and got level 5!\nAs they get stronger, more rewards will be sent to you!", rand(50,150)); + } + return; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index d86046ad..d060ccb7 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -128,6 +128,7 @@ "npc/items/recipes.txt", "npc/items/master_skillbook.txt", "npc/items/music_toys.txt", +"npc/items/gift.txt", // custom atcommands "npc/commands/gm.txt", |