Jump to content
AnnieRuru

Promotional Code

Recommended Posts

I got 2 rep up for making that grumbling post, that just shows how many members really like this idea
and of course I knew many topics talking about this script again and again and again and again and again and again and again and again and again and again and again and again !!!

so I make one myself and hopefully don't want see people talking about that bug script again !!

 

What this script does ?

GM generate some sort of gibberish word and promotes it on social media

then players input that gibberish word and able claim the items

 

honestly I don't really see the point of gibberish word,

I made this script in a drop down menu, players can just select it from the menu and claim it <_<

 

Download: 1.3

script

 

here's an example by Philippine RO, from this post

promotianal_code_example.PNG

 

TODO :

1. add coloring to the text

2. HULD compatible ?

3. maybe someday can rewrite this whole damn thing with .npc_var sync with SQL variables so don't have to call query_sql too frequently

 

Spoiler

1.0 - script

 

1.1 - script

- add list all players that has claimed this code

- add a variable to disable removal of past promotional code, because I know some server has trust issue with other GMs

 

1.2 - script

- fix a bug after the code expire, the "list player has claimed this code" option is missing

- fix a bug that when the code suddenly triggered/start, GM still can do edit

- add some text to tell why players can't claim the code

- add announcement when the Promotion Code activate and expire

 

1.3 - script

- fix a bug the 'Promotion code has Started' didn't even activate after a server restart

- fix a bug when GM edit the start/expire date field, the announcement didn't update along with it ... should have just disable it when countdown initiated

- fix a bug when GM close a promo code, it doesn't announce a GM has closed it, yet its still make announcement about still can claim promo code

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

1.2 - script

- fix a bug after the code expire, the "list player has claimed this code" option is missing

- fix a bug that when the code suddenly triggered/start, GM still can do edit

- add some text to tell why players can't claim the code

- add announcement when the Promotion Code activate and expire

 

EDIT: found another bug, when using EDIT start/expire time, the announcement doesn't react ....
I don't know how to fix this one <-- let's try trigger every hour

 


 

13 hours ago, gidzdlcrz said:

Will this work to rathena? Thanks Annie! ♥

a big word NO

2 conditions then I'll consider

 

No.1 - tell rathena developers to merge *getcalendartime script command

https://github.com/HerculesWS/Hercules/commit/79b69495bbc5d758529a485eb1144bd64b8ea50f

 

No.2 - tell rathena developers that *preg_match to follow the exact PHP style format, that can return $array

https://www.php.net/manual/en/function.preg-match.php

 

currently rathena's preg_match is like this

*preg_match(<regular expression pattern>,<string>{,<offset>})

I want this

*preg_match(<regular expression pattern>,<string>{,<offset>{,<output array>,{<flag>}}})

 

if rathena has these 2 script commands, then only I'll consider
because this script is using them, without these 2 script commands it just won't feel the same functionality if these 2 features are scrap

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

1.3 - script

- fix a bug the 'Promotion code has Started' didn't even activate after a server restart

- fix a bug when GM edit the start/expire date field, the announcement didn't update along with it ... should have just disable it when countdown initiated

- fix a bug when GM close a promo code, it doesn't announce a GM has closed it, yet its still make announcement about still can claim promo code

 

OKies I'm gonna leave this script and go do some other project ...
maybe some other day can come back and rewrite this script entirely with .npc_var only sync with SQL variables so don't have to call query_sql so frequently ...

but as it stands now, this script is 1400 lines, not something to be underestimate

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.